Refactor suite timing out of Env and into each Reporter
[finishes #45659879]
This commit is contained in:
18
src/core/Timer.js
Normal file
18
src/core/Timer.js
Normal file
@@ -0,0 +1,18 @@
|
||||
getJasmineRequireObj().Timer = function() {
|
||||
function Timer(options) {
|
||||
options = options || {};
|
||||
|
||||
var now = options.now || function() { return new Date().getTime(); },
|
||||
startTime;
|
||||
|
||||
this.start = function() {
|
||||
startTime = now();
|
||||
};
|
||||
|
||||
this.elapsed = function() {
|
||||
return now() - startTime;
|
||||
};
|
||||
}
|
||||
|
||||
return Timer;
|
||||
};
|
||||
Reference in New Issue
Block a user