{"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":{"integrity":"sha512-75voc/9G4rDIJleOo4jPvN4/YC4GRZrY8yy1uU4lwrB3XEQbWve8zXoO5No4eFrGcTAMYyoY67p8jRQdtA1HbA==","shasum":"80c76cf5a0ca28e0842d3f10a4e99034ce94b90d","tarball":"http://registry-npm.ywwl.com/time-span/download/time-span-5.1.0.tgz","fileCount":6,"unpackedSize":4336,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqbvEXaeF818zZ3TQuExsxeF1fOq89kGAIXVVDfsbuywIhAP7ocCrinhveYOzVjpy+UklyL4o0atf4xTVPCzZ9CibJ"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiuGcnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpItA/+MECSU7WwNTCyBMn4y/1tfRk+R9orKeu3cdpaYRTjdL5Ng03S\r\nTagXYRgeZHRQNMpCzBUBNZ/r8SpZLoGNjqeXR9hCd9oGOm0wcm4jA7Uggam3\r\nILjSmESvApaZh+zP6HkOwCQpaQ86NSbcw9gwNeajURaYT5sYkUtfp+buMfD1\r\nzfF6OsyLyfT1ZY0LVOrotAR+y84YyxUCWxnQ1Unwap18ypRSthZB+BdJoCia\r\nyT1vv3VfswmJIcksLM5ilbNacWAADP5ANdg5GzwgcioEP/LdRi/WaZYudpsF\r\nbD8Zla5P7z0f87wvo+C0ulqHMZ+qSbaCLGltmIZuQS6G5jeVIrB1TaprU05g\r\nUI+PWDnSyrez8dYODgKM7OwbXuiioy6FYM4vmzfAaAW7qrqr38UIHXx3vWCU\r\nu5vPK5QPB/GTdxHwZ2xBxtCfHGoBXA4CF6OnRsA7Czw52qp8IkJnOTdrKzB9\r\nN2/3P/MGuOWlb/vODsYFWgrcDFMqH8EBfCSl5GevbhWImVd8cHnpMevDF/zX\r\nAa43NTIwQ0srNOAl0YmbNCu4F+0Sp+Ub2i8tV3rXuOe7pomW+aUVmAsnF9oX\r\n9BGnuXsvkbDAXxHqTDVLcl6X07sEaMFcJPlYXmAOoyLGz6grn7915OSd4R2u\r\ndGSSv5pZLQO6uCGL+s9r7Z6kmSIGz73cE4Q=\r\n=gdWk\r\n-----END PGP SIGNATURE-----\r\n","size":1999,"noattachment":false,"key":"/time-span/-/time-span-5.1.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/time-span_5.1.0_1656252199576_0.536266110314402"},"_hasShrinkwrap":false,"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","publish_time":1656252199734,"_cnpm_publish_time":1656252199734,"dist-tags":{"latest":"5.1.0"}}