Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
vltansky committed Apr 30, 2020
1 parent 39a68a3 commit 4490679
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"scripts": {
"build": "rollup -c",
"watch": "rollup -c --watch",
"format": "prettier --write \"src/**/*.js\"",
"format": "prettier --write \"src/**/*.ts\"",
"test": "jest && nyc report --reporter=lcov",
"coverall": "cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage",
"lint": "tslint -p tsconfig.json",
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const _hrtime = (previousTimestamp?: [number, number]):[number, number] => {
const _hrtime = (previousTimestamp?: [number, number]): [number, number] => {
const baseNow = Math.floor((Date.now() - performance.now()) * 1e-3);
let clocktime = performance.now() * 1e-3;
let seconds = Math.floor(clocktime) + baseNow;
Expand All @@ -15,11 +15,11 @@ const _hrtime = (previousTimestamp?: [number, number]):[number, number] => {
return [seconds, nanoseconds];
};
const NS_PER_SEC: number = 1e9;
_hrtime.bigint = (time?: [number, number]):bigint => {
_hrtime.bigint = (time?: [number, number]): bigint => {
const diff = _hrtime(time);
return ((diff[0] * NS_PER_SEC + diff[1]) as unknown) as bigint;
};
if (typeof process === 'undefined') {
window.process = <any>{};
}
export default typeof process.hrtime === 'undefined' ? window.process.hrtime = _hrtime : process.hrtime;
export default typeof process.hrtime === 'undefined' ? (window.process.hrtime = _hrtime) : process.hrtime;

0 comments on commit 4490679

Please sign in to comment.