"Fossies" - the Fresh Open Source Software Archive

Member "node-v12.18.4-win-x86/node_modules/npm/node_modules/performance-now/src/performance-now.coffee" (14 Feb 2020, 570 Bytes) of package /windows/www/node-v12.18.4-win-x86.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Coffeescript source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 if performance? and performance.now
    2   module.exports = -> performance.now()
    3 else if process? and process.hrtime
    4   module.exports = -> (getNanoSeconds() - nodeLoadTime) / 1e6
    5   hrtime = process.hrtime
    6   getNanoSeconds = ->
    7     hr = hrtime()
    8     hr[0] * 1e9 + hr[1]
    9   moduleLoadTime = getNanoSeconds()
   10   upTime = process.uptime() * 1e9
   11   nodeLoadTime = moduleLoadTime - upTime
   12 else if Date.now
   13   module.exports = -> Date.now() - loadTime
   14   loadTime = Date.now()
   15 else
   16   module.exports = -> new Date().getTime() - loadTime
   17   loadTime = new Date().getTime()