git.schokokeks.org
Repositories
Help
Report an Issue
fs-words.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
6e9c872
Branches
Tags
develop-client_server
master
typescript
fs-words.git
server
lib
node_modules
performance-now
src
performance-now.coffee
[add] server:lib:node_modules
Christian Fraß
commited
6e9c872
at 2021-03-08 23:52:07
performance-now.coffee
Blame
History
Raw
if performance? and performance.now module.exports = -> performance.now() else if process? and process.hrtime module.exports = -> (getNanoSeconds() - nodeLoadTime) / 1e6 hrtime = process.hrtime getNanoSeconds = -> hr = hrtime() hr[0] * 1e9 + hr[1] moduleLoadTime = getNanoSeconds() upTime = process.uptime() * 1e9 nodeLoadTime = moduleLoadTime - upTime else if Date.now module.exports = -> Date.now() - loadTime loadTime = Date.now() else module.exports = -> new Date().getTime() - loadTime loadTime = new Date().getTime()