Skip to content

Commit 7726ff2

Browse files
committed
chore: comments
1 parent a8a9901 commit 7726ff2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/helpers/helpers.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,17 +281,21 @@ export const $T = {
281281
* get $perf instance.
282282
* ```ts
283283
* const p = $T.perf()
284-
* const took = p.took();
284+
* ...
285+
* const took = p.took(); // elapsed time in seconds
285286
*/
286287
perf: () => {
287288
return new (class MyPerfmance {
289+
/** the initial timestamp (msec) */
288290
public readonly t0: number;
291+
/** constructor */
289292
public constructor(t0?: number) {
290293
this.t0 = t0 || performance.now(); // start of processing
291294
}
295+
/** get elapsed time (sec) */
292296
public took = () => {
293297
const t1 = performance.now(); // start of processing
294-
const took = Math.round((t1 - this.t0) / 100) / 10; // in sec.
298+
const took = Math.round((t1 - this.t0) / 10) / 100; // in sec.
295299
return took;
296300
};
297301
})();

0 commit comments

Comments
 (0)