'use strict';

// MODULES //

var round = require( '@stdlib/math/base/special/round' );


// MAIN //

/**
* Returns the time in seconds since the epoch.
*
* @returns {integer32} time
*
* @example
* var ts = now();
* // returns <number>
*/
function now() {
	var d = new Date();
	var ts = round( d / 1000 );
	return ts|0; // asm type annotation
} // end FUNCTION now()


// EXPORTS //

module.exports = now;

'use strict';

// MODULES //

var round = require( '@stdlib/math/base/special/round' );


// MAIN //

/**
* Returns the time in seconds since the epoch.
*
* @returns {integer32} time
*
* @example
* var ts = now();
* // returns <number>
*/
function now() {
	var d = new Date();
	var ts = round( d.getTime() / 1000 );
	return ts|0; // asm type annotation
} // end FUNCTION now()


// EXPORTS //

module.exports = now;

Fix `getTime()` bug