def approximate_index(dataset, findvalue):
    """ Return index  value in dataset, with optimized find procedure.
    This assumes a `dataset` with continuous, increasing values. Typically, these are timestamps.

    :param list dataset: a continuous list of values (f.e. timestamps)
    :param int findvalue: the value, of which to find the index.
    """
    length = len(dataset)
    #aproximate index
    diff = (dataset[1] - dataset[0])
    i = min(int((findvalue - dataset[0])/diff), length -1)
    while i < length and i >= 0:
        if i == length -1:
            return i if dataset[i] == findvalue else -1
        if  dataset[i] == findvalue or (dataset[i] < findvalue and dataset[i+1] > findvalue):
            return i
        elif dataset[i] > findvalue:
            i-=1
        else:
            i+=1
    return -1