{"_id":"time-span","_rev":"2906453","name":"time-span","description":"Simplified high resolution timing","dist-tags":{"latest":"5.1.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2022-12-14T07:21:29.000Z","created":"2015-12-10T20:26:14.540Z","5.1.0":"2022-06-26T14:03:19.734Z","5.0.0":"2021-04-14T07:36:20.453Z","4.0.0":"2020-03-12T03:20:36.867Z","3.1.0":"2019-04-05T07:00:45.347Z","3.0.0":"2019-03-08T07:43:57.879Z","2.0.0":"2017-05-23T06:03:26.943Z","1.0.0":"2015-12-10T20:26:14.540Z"},"users":{},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/time-span.git"},"versions":{"5.1.0":{"name":"time-span","version":"5.1.0","description":"Simplified high resolution timing","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/time-span.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","node":"./index.js","default":"./browser.js"},"engines":{"node":">=12"},"scripts":{"test":"xo && ava && tsd"},"keywords":["time","span","elapsed","process","hrtime","highres","timing","perf","performance","bench","benchmark","profiling","measure","seconds","milliseconds","nanoseconds"],"dependencies":{"convert-hrtime":"^5.0.0"},"devDependencies":{"ava":"^3.15.0","delay":"^5.0.0","in-range":"^3.0.0","tsd":"^0.14.0","xo":"^0.38.2"},"types":"./index.d.ts","gitHead":"fc966bb582ac895c4764ef922c896a5db9ebeccf","bugs":{"url":"https://github.com/sindresorhus/time-span/issues"},"homepage":"https://github.com/sindresorhus/time-span#readme","_id":"time-span@5.1.0","_nodeVersion":"18.3.0","_npmVersion":"8.3.2","dist":{"shasum":"80c76cf5a0ca28e0842d3f10a4e99034ce94b90d","size":1999,"noattachment":false,"key":"/time-span/-/time-span-5.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/time-span/download/time-span-5.1.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/time-span_5.1.0_1656252199576_0.536266110314402"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-06-26T14:17:18.601Z","publish_time":1656252199734,"_cnpm_publish_time":1656252199734},"5.0.0":{"name":"time-span","version":"5.0.0","description":"Simplified high resolution timing","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/time-span.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12"},"scripts":{"test":"xo && ava && tsd"},"keywords":["time","span","elapsed","process","hrtime","highres","timing","perf","performance","bench","benchmark","profiling","measure","seconds","milliseconds","nanoseconds"],"dependencies":{"convert-hrtime":"^5.0.0"},"devDependencies":{"ava":"^3.15.0","delay":"^5.0.0","in-range":"^3.0.0","tsd":"^0.14.0","xo":"^0.38.2"},"gitHead":"d85de230a53a36618b3580ad498446231f80cf83","bugs":{"url":"https://github.com/sindresorhus/time-span/issues"},"homepage":"https://github.com/sindresorhus/time-span#readme","_id":"time-span@5.0.0","_nodeVersion":"15.12.0","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"35bf9d75a11ea0f19fbe8282162a55439f58aa8b","size":1776,"noattachment":false,"key":"/time-span/-/time-span-5.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/time-span/download/time-span-5.0.0.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/time-span_5.0.0_1618385780277_0.05069404779858222"},"_hasShrinkwrap":false,"publish_time":1618385780453,"_cnpm_publish_time":1618385780453,"_cnpmcore_publish_time":"2021-12-16T22:59:40.152Z"},"4.0.0":{"name":"time-span","version":"4.0.0","description":"Simplified high resolution timing","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/time-span.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"engines":{"node":">=10"},"scripts":{"test":"xo && ava && tsd"},"keywords":["time","span","elapsed","process","hrtime","highres","timing","perf","performance","bench","benchmark","profiling","measure","seconds","milliseconds","nanoseconds"],"dependencies":{"convert-hrtime":"^3.0.0"},"devDependencies":{"ava":"^1.4.1","delay":"^4.1.0","in-range":"^2.0.0","tsd":"^0.11.0","xo":"^0.24.0"},"gitHead":"3ddda6bce4cbbcff25dcd47aef69849c7b9183bf","bugs":{"url":"https://github.com/sindresorhus/time-span/issues"},"homepage":"https://github.com/sindresorhus/time-span#readme","_id":"time-span@4.0.0","_nodeVersion":"10.18.1","_npmVersion":"6.14.2","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"fe74cd50a54e7998712f90ddfe47109040c985c4","size":1841,"noattachment":false,"key":"/time-span/-/time-span-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/time-span/download/time-span-4.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/time-span_4.0.0_1583983236724_0.21260002612421203"},"_hasShrinkwrap":false,"publish_time":1583983236867,"_cnpm_publish_time":1583983236867,"_cnpmcore_publish_time":"2021-12-16T22:59:40.358Z"},"3.1.0":{"name":"time-span","version":"3.1.0","description":"Simplified high resolution timing","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/time-span.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava && tsd"},"keywords":["time","span","elapsed","process","hrtime","highres","timing","perf","performance","bench","benchmark","profiling","measure","seconds","milliseconds","nanoseconds"],"dependencies":{"convert-hrtime":"^2.0.0"},"devDependencies":{"ava":"^1.4.1","delay":"^4.1.0","in-range":"^1.0.0","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"84b484306d26615f6c3f466b6efb57e86eea98a4","bugs":{"url":"https://github.com/sindresorhus/time-span/issues"},"homepage":"https://github.com/sindresorhus/time-span#readme","_id":"time-span@3.1.0","_nodeVersion":"8.15.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"7c33a0dcc3f46199c966f532ac48442bfc7f7c0d","size":1953,"noattachment":false,"key":"/time-span/-/time-span-3.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/time-span/download/time-span-3.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/time-span_3.1.0_1554447645142_0.9790910402857895"},"_hasShrinkwrap":false,"publish_time":1554447645347,"_cnpm_publish_time":1554447645347,"_cnpmcore_publish_time":"2021-12-16T22:59:40.561Z"},"3.0.0":{"name":"time-span","version":"3.0.0","description":"Simplified high resolution timing","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/time-span.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava && tsd-check"},"keywords":["time","span","elapsed","process","hrtime","highres","timing","perf","performance","bench","benchmark","profiling","measure","seconds","milliseconds","nanoseconds"],"dependencies":{"convert-hrtime":"^2.0.0"},"devDependencies":{"ava":"^1.3.1","delay":"^4.1.0","in-range":"^1.0.0","tsd-check":"^0.3.0","xo":"^0.24.0"},"gitHead":"a2644fd24f587545ac6a5396956c2c4aadf0401c","bugs":{"url":"https://github.com/sindresorhus/time-span/issues"},"homepage":"https://github.com/sindresorhus/time-span#readme","_id":"time-span@3.0.0","_nodeVersion":"8.15.0","_npmVersion":"6.8.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"75957f8754c64e9245394fa22d7f788e1c7e4e86","size":1824,"noattachment":false,"key":"/time-span/-/time-span-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/time-span/download/time-span-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/time-span_3.0.0_1552031037769_0.2444734873241401"},"_hasShrinkwrap":false,"publish_time":1552031037879,"_cnpm_publish_time":1552031037879,"_cnpmcore_publish_time":"2021-12-16T22:59:40.799Z"},"2.0.0":{"name":"time-span","version":"2.0.0","description":"Simplified high resolution timing","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/time-span.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["time","span","elapsed","process","hrtime","highres","timing","perf","performance","bench","benchmark","profiling","measure","seconds","milliseconds","nanoseconds"],"dependencies":{"convert-hrtime":"^2.0.0"},"devDependencies":{"ava":"*","delay":"^2.0.0","in-range":"^1.0.0","xo":"*"},"gitHead":"f96cf85047bd18d437c28be8ea628a1e31698ba2","bugs":{"url":"https://github.com/sindresorhus/time-span/issues"},"homepage":"https://github.com/sindresorhus/time-span#readme","_id":"time-span@2.0.0","_shasum":"e7624a37917a49729dbf3b7c47c5b799440e532f","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.8.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"e7624a37917a49729dbf3b7c47c5b799440e532f","size":1672,"noattachment":false,"key":"/time-span/-/time-span-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/time-span/download/time-span-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/time-span-2.0.0.tgz_1495519406864_0.48803993011824787"},"directories":{},"publish_time":1495519406943,"_hasShrinkwrap":false,"_cnpm_publish_time":1495519406943,"_cnpmcore_publish_time":"2021-12-16T22:59:41.013Z"},"1.0.0":{"name":"time-span","version":"1.0.0","description":"Simplified high resolution timing","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/time-span"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["time","span","elapsed","process","hrtime","highres","timing","perf","performance","bench","benchmark","profiling","measure","seconds","milliseconds","nanoseconds"],"dependencies":{"convert-hrtime":"^1.0.0"},"devDependencies":{"ava":"*","delay":"^1.1.0","in-range":"^1.0.0","xo":"*"},"xo":{"ignores":["test.js"]},"gitHead":"ea9533c0818583dd973fc4235bcce08e77bde0b0","bugs":{"url":"https://github.com/sindresorhus/time-span/issues"},"homepage":"https://github.com/sindresorhus/time-span","_id":"time-span@1.0.0","_shasum":"a76131cce8f12672a5a6a7a248367a5664a2d174","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"a76131cce8f12672a5a6a7a248367a5664a2d174","size":1715,"noattachment":false,"key":"/time-span/-/time-span-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/time-span/download/time-span-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1449779174540,"_hasShrinkwrap":false,"_cnpm_publish_time":1449779174540,"_cnpmcore_publish_time":"2021-12-16T22:59:41.213Z"}},"readme":"# time-span\n\n> Simplified high resolution timing\n\nUses [`process.hrtime`](https://nodejs.org/api/process.html#processhrtimebigint) in Node.js and [`performance.now`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/now) in browsers ([accurate to 5 microseconds](https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp)).\n\n## Install\n\n```\n$ npm install time-span\n```\n\n## Usage\n\n```js\nimport timeSpan from 'time-span';\n\nconst end = timeSpan();\n\ntimeConsumingFn();\n\nconsole.log(end());\n//=> 1745.3186\n\nconsole.log(end.rounded());\n//=> 1745\n\nconsole.log(end.seconds());\n//=> 1.7453186\n```\n\n## API\n\n### `const end = timeSpan()`\n\nReturns a function, that when called, returns the time difference.\n\n#### end()\n\nElapsed milliseconds.\n\n#### end.rounded()\n\nElapsed milliseconds rounded.\n\n#### end.seconds()\n\nElapsed seconds.\n\n#### end.nanoseconds()\n\nElapsed nanoseconds.\n","_attachments":{},"homepage":"https://github.com/sindresorhus/time-span#readme","bugs":{"url":"https://github.com/sindresorhus/time-span/issues"},"license":"MIT"}