def METHOD_NAME(timeout=0.001):
    "ping wx"
    try:
        t0 = clock()
        app = wx.GetApp()
        if app is not None:
            assert wx.IsMainThread()
            # Make a temporary event loop and process system events until
            # there are no more waiting, then allow idle events (which
            # will also deal with pending or posted wx events.)
            evtloop = wx_EventLoop()
            ea = wx.EventLoopActivator(evtloop)
            t0 = clock()
            while clock()-t0 < timeout:
                evtloop.Dispatch()
            app.ProcessIdle()
            del ea
    except:
        pass