mirror of
https://github.com/ascribe/onion.git
synced 2025-01-21 02:01:56 +01:00
16 lines
250 B
JavaScript
16 lines
250 B
JavaScript
|
'use strict'
|
||
|
|
||
|
var startTime = null;
|
||
|
|
||
|
export function startTimer() {
|
||
|
startTime = new Date();
|
||
|
};
|
||
|
|
||
|
export function endTimer() {
|
||
|
if (startTime) {
|
||
|
const time = new Date() - startTime;
|
||
|
startTime = null;
|
||
|
return time;
|
||
|
}
|
||
|
}
|