1
0
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:
Jermolene 2014-03-31 18:42:30 +01:00
parent 53ca7f6a2f
commit dcce487934

View File

@ -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;