ソースを参照

clarify calculation of process.hrtime

Brian Gough 9 年 前
親
コミット
95596061d4
1 ファイル変更、3 行追加、1 行削除
  1. 3 1
      services/document-updater/app/coffee/Profiler.coffee

+ 3 - 1
services/document-updater/app/coffee/Profiler.coffee

@@ -2,7 +2,9 @@ Settings = require('settings-sharelatex')
 logger = require('logger-sharelatex')
 logger = require('logger-sharelatex')
 
 
 deltaMs = (ta, tb) ->
 deltaMs = (ta, tb) ->
-	return Math.floor(((ta[0]-tb[0])*1e9 + (ta[1]-tb[1]))*1e-6)
+	nanoSeconds = (ta[0]-tb[0])*1e9 + (ta[1]-tb[1])
+	milliSeconds = Math.floor(nanoSeconds*1e-6)
+	return milliSeconds
 
 
 module.exports = class Profiler
 module.exports = class Profiler
 	LOG_CUTOFF_TIME: 1000
 	LOG_CUTOFF_TIME: 1000