Delayed execution

About Monkey 2 Forums Monkey 2 Programming Help Delayed execution

This topic contains 4 replies, has 3 voices, and was last updated by  nerobot 2 years, 7 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #3465

    nerobot
    Participant

    How can I start method after N millisecs from the this moment ?

    Try to write waiting logic inside fiber – not working, it suspended after few calls.

    What I need at all? Call to RequestRender each N millisecs.

    #3489

    Mark Sibly
    Keymaster

    Check out the Timer code in spacechimps, the basic idea is:

    New Timer( 60,OnUpdate )

    Method OnUpdate()
    End

    I plan to add a ‘Sleep’ function to Fiber too.

    #3491

    Cole Chapman
    Participant

    If you are looking for a wait function, this is what I use:

    This executes at 15 hertz.  If you want to set a time, just change WaitTime to however many Microseconds you would like.

    I couldn’t find any Delay or Wait function in the docs but I could have overlooked…

    #3492

    Mark Sibly
    Keymaster

    Be careful – UpdateWindows is currently a hidden API and may or may not change in future or may become private etc (it probably should be).

    I’ll have a go at adding App.Sleep…

    #3493

    nerobot
    Participant

    The Timer class is what I’m looking for, thanks!

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.