contract TimerController {
    using TimerLib for TimerLib.Timer;
    TimerLib.Timer private _timer;

    /// @dev makes sure the timer is running
    modifier onlyRunning() {
        require(_isTimerRunning(), "timer over");
        _;
    }

    /// @dev returns the timer data
    function _getTimerData() internal view returns (TimerData memory) {
        return TimerData(_timer.startTime, _timer.runningTime);
    }

    /// @dev checks if the timer is still running
    function _isTimerRunning() internal view returns (bool) {
        return _timer._isRunning();
    }

    /// @dev should be called in the constructor
    function _startTimer(uint256 endsInHours) internal {
        _timer._start(endsInHours * 1 hours);
    }

    /// @dev set a new end time in hours (from the given time)
    function _setTimerEndsInHours(uint256 endsInHours) internal {
        _timer._updateRunningTime(endsInHours * 1 hours);
    }
}
function _startTimer(uint256 endsInHours) internal {
    _timer._start(endsInHours * 1 hours);
}

/// @dev should be called in the constructor