File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff 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 } ) ( ) ;
You can’t perform that action at this time.
0 commit comments