auto fade out
This commit is contained in:
11
lib/util.js
11
lib/util.js
@@ -48,4 +48,13 @@ exports.average = function(e) {
|
||||
return avg;
|
||||
};
|
||||
|
||||
exports.randSort = () => { return 0.5 - Math.random() };
|
||||
exports.randSort = () => { return 0.5 - Math.random() };
|
||||
|
||||
exports.sleep = (milliseconds) => {
|
||||
var start = new Date().getTime();
|
||||
for (var i = 0; i < 1e7; i++) {
|
||||
if ((new Date().getTime() - start) > milliseconds){
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user