mirror of
https://github.com/alexankitty/Myrient-Search-Engine.git
synced 2026-01-15 16:33:15 -03:00
* separate kws based on categories * auto include kws based on field options * add roman numeral parse * add number to name * split out json search alikes to be per category * add new kws columns to Files * add search sample for determining if a game is in a series (maybe this could be useful somewhere else, too)
17 lines
475 B
JavaScript
17 lines
475 B
JavaScript
export class timer {
|
|
constructor() {
|
|
this.startTime = process.hrtime();
|
|
}
|
|
parseHrtimetoSeconds(hrtime) {
|
|
var seconds = (hrtime[0] + hrtime[1] / 1e9).toFixed(3);
|
|
return seconds;
|
|
}
|
|
elapsed() {
|
|
let elapsed = this.parseHrtimetoSeconds(process.hrtime(this.startTime));
|
|
let h = Math.floor(elapsed / 3600);
|
|
let m = Math.floor(elapsed / 60);
|
|
let s = Math.floor(elapsed % 60);
|
|
return `${h ? h + "h" : ""}${m ? m + "m" : ""}${s + "s"}`;
|
|
}
|
|
}
|