1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-10-20 02:07:38 +00:00

Correct relative date handling of t=1s

We were incorrectly displaying “1 seconds ago”
This commit is contained in:
Jermolene
2014-03-31 12:41:54 +01:00
parent 5a085f7927
commit 914a536d82
2 changed files with 22 additions and 3 deletions

View File

@@ -239,7 +239,7 @@ exports.getRelativeDate = function(delta) {
return {
delta: delta,
description: $tw.language.getString(
"RelativeDate/" + (futurep ? "Future" : "Past") + "/Seconds",
"RelativeDate/" + (futurep ? "Future" : "Past") + "/Second",
{variables:
{period: "1"}
}
@@ -451,4 +451,21 @@ exports.makeTiddlerDictionary = function(data) {
return output.join("\n");
};
/*
High resolution microsecond timer for profiling
*/
exports.timer = function(base) {
var m;
if($tw.node) {
var r = process.hrtime();
m = r[0] * 1e3 + (r[1] / 1e6);
} else {
m = performance.now();
}
if(typeof base !== "undefined") {
m = m - base;
}
return m;
}
})();