add Ox.time
This commit is contained in:
parent
ef07c50fff
commit
420dd7f266
1 changed files with 10 additions and 0 deletions
|
@ -147,3 +147,13 @@ Ox.queue = function(fn, maxThreads) {
|
|||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
/*@
|
||||
Ox.time <f> Returns the time it takes to execute a given function
|
||||
(fn) -> <n> Time in milliseconds
|
||||
@*/
|
||||
Ox.time = function(fn) {
|
||||
var time = new Date;
|
||||
fn();
|
||||
return new Date() - time;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue