|Go to Page...|
|Updated:||10-16-08 10:20 PM|
Chronos manages time. You can schedule a function to be called in X seconds, with or without an id. You can request a timer, which tracks the elapsed duration since the timer was started.
Chronos provides functionality that makes tracking timed tasks and distributed tasks easier. This addon is a function library. This means that it doesn't have any UI on it's own, but rather provides functionality for other addons. If you are an addon user and not an addon developer all you need to do is to leave this addon turned on if you have any other addons that depend on it.
Chronos.schedule(10, foo, "a");
Will call foo("a") in 10 seconds.
Note: Do not include () after your function name, which coders tend do to often like Chronos.schedule(10, foo'''()''', "a"); this causes your function to be called immediately and Chronos will try to "call" the return value of your function after the specified interval (which is not neccesarily bad if your function returns a function...)
delta = Chronos.endTimer("SomeID");
Will return the amount of time needed to run foo.