|
wedrifid Beginner
Joined: 10 Dec 2006 Posts: 15
|
Posted: Tue Jan 09, 2007 6:31 am
Precise timing |
#alarm is useful for setting up triggers that will be fired in (say) 10 seconds. I am trying to work out the best way to set up a trigger that will fire in something like 750 milliseconds. Is this possible?
My options are currently:
- Identify some CMUD feature that I am unaware of.
- Use the com interface to write my own more accurate timer.
- Hack a %secs polling loop to manage the timing artificially within the alias. This has the downside of being ugly and complicating the queuing of multiple timed commands.
- Use #wait. This is tantamount to heresy. It also complicates the queuing of multiple timed commands.
|
|
|
|
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Tue Jan 09, 2007 7:12 am |
#ALARM should work just fine with 750ms
#say %secs
#alarm test {+0.75} {#say %secs}
Came out to exactly 750ms for me
When down to +0.1 then it was a bit less accurate - around 110ms
But for anything over about half a second it should be spot on |
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
|
wedrifid Beginner
Joined: 10 Dec 2006 Posts: 15
|
Posted: Tue Jan 09, 2007 8:16 am |
Thanks, hopefully that is close enough to be roughly as good as timing manually.
|
|
|
|
|
|