Always use setImmediate on Node.js
This commit is contained in:
@@ -73,7 +73,6 @@ class NativeApplication {
|
|||||||
|
|
||||||
lime_application_init (handle);
|
lime_application_init (handle);
|
||||||
|
|
||||||
var prevTime = untyped __js__ ('Date.now ()');
|
|
||||||
var eventLoop = function () {
|
var eventLoop = function () {
|
||||||
|
|
||||||
var active = lime_application_update (handle);
|
var active = lime_application_update (handle);
|
||||||
@@ -86,23 +85,12 @@ class NativeApplication {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var time = untyped __js__ ('Date.now ()');
|
untyped setImmediate (eventLoop);
|
||||||
if (time - prevTime <= 16) {
|
|
||||||
|
|
||||||
untyped setTimeout (eventLoop, 0);
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
|
|
||||||
untyped setImmediate (eventLoop);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
prevTime = time;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
untyped setImmediate (eventLoop);
|
untyped setImmediate (eventLoop);
|
||||||
|
return 0;
|
||||||
|
|
||||||
#elseif (cpp || neko)
|
#elseif (cpp || neko)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user