def METHOD_NAME(delay):
    """Register callback to stop eventloop after a delay"""
    timer = CFRunLoopTimerCreate(
        None, # allocator
        CFAbsoluteTimeGetCurrent() + delay, # fireDate
        0, # interval
        0, # flags
        0, # order
        _c_stop_callback,
        None,
    )
    CFRunLoopAddTimer(
        CFRunLoopGetMain(),
        timer,
        kCFRunLoopCommonModes,
    )