Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

convert-hrtime

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

convert-hrtime - npm Package Compare versions

Comparing version 4.0.0 to 5.0.0

6

index.d.ts
export interface HighResolutionTime {
seconds: bigint;
milliseconds: bigint;
seconds: number;
milliseconds: number;
nanoseconds: bigint;

@@ -19,5 +19,5 @@ }

convertHrtime(diff);
//=> {seconds: 0.000002399, milliseconds: 0.002399, nanoseconds: 2399}
//=> {seconds: 0.000002399, milliseconds: 0.002399, nanoseconds: 2399n}
```
*/
export default function convertHrtime(hrtime: bigint): HighResolutionTime;
export default function convertHrtime(hrtime) {
const nanoseconds = hrtime;
const milliseconds = nanoseconds / 1000000n;
const seconds = nanoseconds / 1000000000n;
const number = Number(nanoseconds);
const milliseconds = number / 1000000;
const seconds = number / 1000000000;

@@ -6,0 +7,0 @@ return {

{
"name": "convert-hrtime",
"version": "4.0.0",
"version": "5.0.0",
"description": "Convert the result of `process.hrtime.bigint()` to seconds, milliseconds, nanoseconds",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -21,3 +21,3 @@ # convert-hrtime

convertHrtime(diff);
//=> {seconds: 0.000002399, milliseconds: 0.002399, nanoseconds: 2399}
//=> {seconds: 0.000002399, milliseconds: 0.002399, nanoseconds: 2399n}
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc