Closed smartaslst closed 1 year ago
IsolatedWorker().run(sum, 1000).then(value) { print(s) }
int sum(int a) { int s = 0; for (int i = 0; i < a; i++) { s = s + i; }
return s; }
This code is working well for mobile. But not for web. I don't use same code for both mobile and web. Please help me
for web, should use JsIsolatedWorker
Closing this as you should use JsIsolatedWorker on web as mentioned above.
JsIsolatedWorker
IsolatedWorker().run(sum, 1000).then(value) { print(s) }
int sum(int a) { int s = 0; for (int i = 0; i < a; i++) { s = s + i; }
return s; }
This code is working well for mobile. But not for web. I don't use same code for both mobile and web. Please help me