nano-seconds
Get the nano seconds of now
Installation
$ npm install nano-seconds
API
now
Get the nano seconds of current time, it will return [seconds, nanos]
const nano = ;// [ 1488895112, 951851969 ]console;
toString
Format the nano seconds to string
ns
if not set the param, it will benano.now()
const nano = ;const ns = nano;// [ 1488895353, 21164240 ]console;// 1488895353021164240console;// 1488895353025439741console;
toISOString
Format the nano seconds to ISOString
ns
if not set the param, it will benano.now()
const nano = ;const ns = nano;// 2017-06-22T14:37:42.506635539Zconsole;// 2017-06-22T14:37:42.5069231Zconsole;
fromISOString
Get the nano from ISOString
iosFormat
ISO Date String
const nano = ;const arr = nano;// [ 1505477440, 922020280 ]console;
difference
Get the difference of two nano seconds, ns2 - ns1
-
ns1
The start nano seconds -
ns2
The end nano seconds, default isnano.now()
const ns = nano;;
License
MIT