Ext.define('InternalTimer', {
    constructor:function (specialAction) {
        this.SpecialActionRef = specialAction;
        this.StartTime = null;
    },
    start:function () {
        this.StartTime = new Date();
    },
    getTimerValue:function () {
        if (this.StartTime == null) {
            return -1;
        } else {
            return new Date() - this.StartTime;
        }
    },
    toString:function () {
        var specialActionID = "null";
        if (this.SpecialActionRef != null){
            specialActionID = this.SpecialActionRef.id;
        }

        return Ext.String.format("InternalTimer:\nSpecialActionID:{0}\nStart time: {1}\nTimer: {2}", specialActionID, Ext.util.Format.date(this.StartTime, "g:i:s A"), this.getTimerValue());
    }
});