time-to-botec/js/node_modules/@stdlib/time/tic/README.md
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00

2.0 KiB

tic

Return a high-resolution time.

Usage

var tic = require( '@stdlib/time/tic' );

tic()

Returns a high-resolution time.

var t = tic();
// returns [<number>,<number>]

The returned array has the following format: [seconds, nanoseconds].

Notes

Examples

var tic = require( '@stdlib/time/tic' );
var toc = require( '@stdlib/time/toc' );

var start = tic();

setTimeout( onTimeout, 2000 );

function onTimeout() {
    var elapsed = toc( start );
    console.log( 'Elapsed: %d seconds and %d nanoseconds', elapsed[0], elapsed[1] );
}