fabianmoronzirfas
7/24/2017 - 12:14 PM

index.js

{
  "name": "intervals",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "dependencies": {
    "present": "^1.0.0"
  },
  "devDependencies": {},
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "Fabian Morón Zirfas <fabian.moron.zirfas@gmail.com> (http://fabianmoronzirfas.me)",
  "license": "ISC"
}
var present = require('present');

var t1 = present();

setTimeout(function() {
  console.log('time is over');
  var t2 = present();
  console.log(`This is t1: ${t1}`);
  console.log(`This is t2: ${t2}`);
  console.log(`this is the difference ${t2 - t1}`);
}, 500);