• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Basics-RunLoops

Page history last edited by Charles Jolley 15 years, 3 months ago
  • What is a Runloop?  - Wrapper function that runs at the beginning and end of each event handler.  Also provides a uniform scheduler for timeouts.
  • Why use RunLoops?
    • More consistent timing
    • Gives you a way to defer execution of some events until the end of the loop or until a later time.  This can dramatically improve performance at times
  • Using RunLoops in your own app    
    • Always begin and end each event handler with SC.RunLoop.begin() & SC.RunLoop.end()
    • Use Function.invokeLater() instead of timeouts
    • Use Function.invokeOnce() to exec updates only once.

 

Comments (0)

You don't have permission to comment on this page.