function Timer(operation, interval)
{
    this.operation = operation;
    this.interval = interval;
    this.started = false;
}

Timer.prototype.start = function()
{
    if (this.started) return;
    this.timer = setInterval(this.operation, this.interval);
    this.started = true;
}

Timer.prototype.stop = function()
{
    if (!this.started) return;
    clearInterval(this.timer);
}

