I need a timer for my program so my idea was to use the Date() and a future date to make the difference between them a timer,but i have been having problems with Date() functions,where the future
returns null
var date = new Date();
var future = date.setMinutes(date.getMinutes + 3);
console.log(future); //prints NAN
var distance = future - date;
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);