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

time-span

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

time-span - npm Package Compare versions

Comparing version 3.0.0 to 3.1.0

75

index.d.ts

@@ -1,28 +0,57 @@

/**
* @returns Elapsed milliseconds.
*/
export interface TimeEndFunction {
(): number;
declare namespace timeSpan {
interface TimeEndFunction {
/**
@returns Elapsed milliseconds.
*/
(): number;
/**
* @returns Elapsed milliseconds rounded.
*/
rounded(): number;
/**
@returns Elapsed milliseconds rounded.
*/
rounded(): number;
/**
* @returns Elapsed seconds.
*/
seconds(): number;
/**
@returns Elapsed seconds.
*/
seconds(): number;
/**
* @returns Elapsed nanoseconds.
*/
nanoseconds(): number;
/**
@returns Elapsed nanoseconds.
*/
nanoseconds(): number;
}
}
/**
* Simplified high resolution timing.
*
* @returns A function that returns the time difference.
*/
export default function timeSpan(): TimeEndFunction;
declare const timeSpan: {
/**
Simplified high resolution timing.
@returns A function that returns the time difference.
@example
```
import timeSpan = require('time-span');
const end = timeSpan();
timeConsumingFn();
console.log(end());
//=> 1745.3186
console.log(end.rounded());
//=> 1745
console.log(end.seconds());
//=> 1.7453186
```
*/
(): timeSpan.TimeEndFunction;
// TODO: Remove this for the next major release, refactor the whole definition to:
// declare function timeSpan(): timeSpan.TimeEndFunction;
// export = timeSpan;
default: typeof timeSpan;
};
export = timeSpan;

@@ -17,2 +17,3 @@ 'use strict';

module.exports = timeSpan;
// TODO: Remove this for the next major release
module.exports.default = timeSpan;
{
"name": "time-span",
"version": "3.0.0",
"version": "3.1.0",
"description": "Simplified high resolution timing",

@@ -16,3 +16,3 @@ "license": "MIT",

"scripts": {
"test": "xo && ava && tsd-check"
"test": "xo && ava && tsd"
},

@@ -45,8 +45,8 @@ "files": [

"devDependencies": {
"ava": "^1.3.1",
"ava": "^1.4.1",
"delay": "^4.1.0",
"in-range": "^1.0.0",
"tsd-check": "^0.3.0",
"tsd": "^0.7.2",
"xo": "^0.24.0"
}
}
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