mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Add precise definitions and tests.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
/// <reference path="precise.d.ts" />
|
||||
|
||||
import precise = require("precise");
|
||||
|
||||
var timer = precise().start();
|
||||
|
||||
setTimeout(function () {
|
||||
console.log(timer.stop().diff());
|
||||
}, 1000);
|
||||
Vendored
+34
@@ -0,0 +1,34 @@
|
||||
// Type definitions for precise
|
||||
// Project: https://github.com/avoidwork/precise
|
||||
// Definitions by: Peter Harris <https://github.com/codeanimal>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module "precise" {
|
||||
/**
|
||||
* Precise factory
|
||||
*/
|
||||
function _precise(): _precise.Precise;
|
||||
|
||||
module _precise {
|
||||
class Precise {
|
||||
constructor();
|
||||
|
||||
/**
|
||||
* Starts a timer
|
||||
*/
|
||||
start(): Precise;
|
||||
|
||||
/**
|
||||
* Stops a timer
|
||||
*/
|
||||
stop(): Precise;
|
||||
|
||||
/**
|
||||
* Returns the nanoseconds from `start()` to `stop()`
|
||||
*/
|
||||
diff(): number;
|
||||
}
|
||||
}
|
||||
|
||||
export = _precise;
|
||||
}
|
||||
Reference in New Issue
Block a user