def METHOD_NAME(self, delay=0.0):
    '''
    Indicate that the measurement is idle and handle events.
    This function will check whether an abort has been requested and
    handle queued events for a time up to 'delay' (in seconds).
    Be aware that both time.time and time.sleep have a granularity of around 15ms on windows.
    However, this should not be limiting.
    It starts by emitting the 'measurement-idle' signal to allow callbacks
    to be executed by the time this function handles the event queue.
    After that it handles events and sleeps for periods of 10msec. Every
    <emit_interval> seconds it will emit another measurement-idle signal.
    '''
    start = time.time()
    while self._pause:
        self.check_abort()
        self.run_mainloop(0.01,wait=True)
    while True:
        self.check_abort()
        dt = time.time() - start
        self.run_mainloop(delay-dt, wait=False)
        dt = time.time() - start
        if dt + 0.02 < delay:
            time.sleep(0.05)
        else:
            time.sleep(max(0, delay - dt))
            return