@smarterservices/smarterclock
Advanced tools
Comparing version 1.0.9 to 1.1.1
@@ -50,3 +50,3 @@ var smarterClock = function (config) { | ||
//get avg delta of your local time compared to ntp time | ||
var avg = Math.round(sum / this.delta.length); | ||
var avg = Math.round(sum / this.delta.length)||0; | ||
//return your time +/- the avg delta | ||
@@ -53,0 +53,0 @@ return ((new Date()).getTime() + avg); |
{ | ||
"name": "@smarterservices/smarterclock", | ||
"version": "1.0.9", | ||
"version": "1.1.1", | ||
"description": "store of delta values between ntp time and local time to get an accurate sync time", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
var smarterclock = require('./index.js'); | ||
var clock = new smarterclock(); | ||
var clock = new smarterclock({}); | ||
var syncTime = clock.getTime(); | ||
console.log('SyncTime:' + syncTime); | ||
setInterval(function(){ | ||
@@ -7,0 +8,0 @@ var localTime = new Date().getTime(); |
7304
91