mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 18:17:20 +00:00
Add support for platform dependent high resolution performance timers
For profiling filter performance
This commit is contained in:
parent
53ca7f6a2f
commit
dcce487934
@ -459,8 +459,10 @@ exports.timer = function(base) {
|
||||
if($tw.node) {
|
||||
var r = process.hrtime();
|
||||
m = r[0] * 1e3 + (r[1] / 1e6);
|
||||
} else {
|
||||
} else if(window.performance) {
|
||||
m = performance.now();
|
||||
} else {
|
||||
m = new Date();
|
||||
}
|
||||
if(typeof base !== "undefined") {
|
||||
m = m - base;
|
||||
|
Loading…
Reference in New Issue
Block a user