Update task.js

This commit is contained in:
Namhyeon Go 2021-06-23 14:28:19 +09:00 committed by GitHub
parent 4c0b5f8946
commit 364e13bb18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -141,18 +141,41 @@ exports.setTimeout = function() {
var f = null; var f = null;
var delay = 0; var delay = 0;
var params = []; var params = [];
var args = arguments;
if (arguments.length > 2) { if (args.length > 2) {
f = arguments[0]; f = arguments[0];
delay = arguments[1]; delay = args[1];
params = arguments.slice(2); params = args.slice(2);
} else if (arguments.length == 2) { } else if (arguments.length == 2) {
f = arguments[0]; f = args[0];
delay = arguments[1]; delay = args[1];
} }
if (f != null) { if (f != null) {
var when = new Date().getTime() + delay;
// ... todo ...
}
};
exports.setInterval = function() {
var f = null;
var delay = 0;
var params = [];
var args = arguments;
if (arguments.length > 2) {
f = args[0];
delay = args[1];
params = args.slice(2);
} else if (arguments.length == 2) {
f = args[0];
delay = args[1];
}
if (f != null) {
var when = new Date().getTime() + delay;
// ... todo ...
} }
}; };
*/ */