Sha256: c77ee70a334eb29f5f4af99ddd1cb839d7ec15f438d6dcacaf6aef04b1d13230

Contents?: true

Size: 554 Bytes

Versions: 9

Compression:

Stored size: 554 Bytes

Contents

/*global Class */

// Timer class for use with auto-updating of game status'.
window.Timer = Class.extend({
    initialize: function(func, period) {
        this.func = func;
        this.period = period;
        this.interval = null;
    },
    // startNow: function() {
    //     this.func();
    //     this.interval = window.setInterval(this.func, this.period);
    // },
    start: function() {
        this.interval = window.setInterval(this.func, this.period);
    },
    stop: function() {
        window.clearInterval(this.interval);
    }
});

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
sports_db-0.2.12 app/assets/javascripts/core/Timer.js
sports_db-0.2.11 app/assets/javascripts/core/Timer.js
sports_db-0.2.10 app/assets/javascripts/core/Timer.js
sports_db-0.2.9 app/assets/javascripts/core/Timer.js
sports_db-0.2.8 app/assets/javascripts/core/Timer.js
sports_db-0.2.7 app/assets/javascripts/core/Timer.js
sports_db-0.2.6 app/assets/javascripts/core/Timer.js
sports_db-0.2.5 app/assets/javascripts/core/Timer.js
sports_db-0.2.4 app/assets/javascripts/core/Timer.js