offset.js 321 B

12345678910111213141516
  1. var Sntp = require('../lib');
  2. // Request offset once
  3. Sntp.offset(function (err, offset) {
  4. console.log(offset); // New (served fresh)
  5. // Request offset again
  6. Sntp.offset(function (err, offset) {
  7. console.log(offset); // Identical (served from cache)
  8. });
  9. });