def get_samplerate_mstimer(timerdata):
    """detemine sample rate based on ms timer

    Function to determine sample rate of data from ms-based timer list or array.

    Parameters
    ----------
    timerdata : 1d numpy array or list
        sequence containing values of a timer, in ms

    Returns
    -------
    out : float
        the sample rate as determined from the timer sequence provided
        
    Examples
    --------
    first we load a provided example dataset

    >>> data, timer = load_exampledata(example = 1)
    
    since it's a timer that counts miliseconds, we use this function.
    Let's also round to three decimals

    >>> round(get_samplerate_mstimer(timer), 3)
    116.996

    of course if another time unit is used, converting it to ms-based
    should be trivial.
    """
    sample_rate = len(timerdata) / (timerdata[-1] - timerdata[0]) * 1000
    return sample_rate
