1 MILS_PER_SECOND = 1000;
2 MILS_PER_MINUTE = 60 * MILS_PER_SECOND;
3 MILS_PER_HOUR = 60 * MILS_PER_MINUTE;
7 this.pomo = document.getElementById("pomo");
8 this.start = function() {
9 this.date = new Date();
10 setTimeout(function() {
14 this.prefix = function(i) {
20 this.update = function() {
22 var mils = this.date.getTime() + 25 * MILS_PER_MINUTE - now.getTime();
27 setTimeout(function() {
31 var hours = Math.floor(mils / MILS_PER_HOUR);
32 mils -= hours * MILS_PER_HOUR;
33 var minutes = Math.floor(mils / MILS_PER_MINUTE);
34 mils -= minutes * MILS_PER_MINUTE;
35 var seconds = Math.floor(mils / MILS_PER_SECOND);
36 var s_date = this.prefix(hours) + ":" + this.prefix(minutes) + ":" + this.prefix(seconds);
37 this.pomo.innerHTML = s_date;
39 this.alarm = function() {
40 var audio = document.getElementById("alarm");
45 var pomo = new Pomo();