var TimeControl = /** @class */ (function () {
    function TimeControl(viewer, cCl) {
        var _this = this;
        this._rate = 0;
        this._viewer = viewer;
        this._scene = viewer.scene;
        this._startJulianDate = viewer.clock.currentTime;
        var _last = 0;
        cCl.on('tick', function (_t) {
            var r = _this._rate;
            if (r) {
                viewer.clock.currentTime.secondsOfDay += ((_t - _last) * r) / 1000;
                _last = _t;
            }
        });
    }
    Object.defineProperty(TimeControl.prototype, "TimeRate", {
        get: function () {
            return this._rate;
        },
        set: function (val) {
            this._rate = val;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(TimeControl.prototype, "StartJulianDate", {
        get: function () {
            return this._startJulianDate;
        },
        enumerable: false,
        configurable: true
    });
    return TimeControl;
}());
export default TimeControl;
