time-to-botec/js/node_modules/@stdlib/time/now/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

1.8 KiB

now

Time in seconds since the epoch.

Usage

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

now()

Returns the time in seconds since the epoch.

var ts = now();
// returns <number>

Notes

  • The Unix epoch is 00:00:00 UTC on 1 January 1970.

Examples

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

var t0 = now();

setTimeout( onTimeout, 2000 );

function onTimeout() {
    var t1 = now();
    console.log( 'Seconds elapsed: %d', t1-t0 );
}

CLI

Usage

Usage: now [options]

Options:

  -h,    --help                Print this message.
  -V,    --version             Print the package version.

Examples

$ now
<number>