Backend half
This commit is contained in:
+9
@@ -0,0 +1,9 @@
|
||||
module.exports = {
|
||||
//provide realtime clock for performance measurement
|
||||
now: function now() {
|
||||
if (typeof performance !== 'undefined' && typeof performance.now === 'function') {
|
||||
return performance.now();
|
||||
}
|
||||
return Date.now();
|
||||
}
|
||||
};
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
module.exports = {
|
||||
//provide realtime clock for performance measurement
|
||||
now: function now() {
|
||||
var second = process.hrtime();
|
||||
return second[0] * 1000 + (second[1] / 1000000);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user