|
||
---|---|---|
.. | ||
bin | ||
docs | ||
etc | ||
lib | ||
package.json | ||
README.md |
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>