Extension of pre-pub testing for ns performance timer plugin

Dar Scott dsc at swcp.com
Sun Aug 6 14:09:02 EDT 2006


Well, the timer resolution is closer to microsecond than nanosecond,  
but it is high resolution.

I decided to wait a couple days before publishing the FREE timer plugin.

If you want to help me out and want to influence how this turns out,  
let me know and I'll send you a pre-publication version to play with.

This is a plugin that makes a few timer related functions and  
commands available in your IDE.  You can use these in your scripts to  
time how long certain operations take.

You can use 'the long seconds', of course, but that does not have the  
resolution on Windows that it does on OS X.  Also, it does not have  
built-in calibration for timing and the uniform timing commands and  
functions.  On Windows you can time short operations by repeating  
them, but in some cases that cannot work.  This might be because the  
operation changes the situation, such as closing a file, or because  
you need to time in a live test.

The high resolution timer plugin takes care of that.  It sets up a  
uniform timing API and adds very high res timing to Windows.

The new commands can be inserted as a front script or as a stack  
library.  The first is better for timing built-in operations, the  
latter is better for timing scripts with lots of calls.  The plugin  
is a single stack so you can't lose supporting stacks and externals;  
they are embedded.

I've been calling this darzStopwatch, but might change that to  
darzTimer or something.

So, if you have any of the gifts of encouragement, making snide  
remarks, nitpicking, clocks on Windows machines, whining, GUI and so  
on, please help me out.

I've only checked this out on a single processor Athlon for Windows  
XP and a dual G4 for OS X, so if you have something different  
(especially old, mobile, weird PCI, or OS X on Intel) that will help.

Besides the plugin, I'll send a small demo stack that times "repeat n  
times".  With this timer you can see the difference in times as you  
move from 0 times, to 1 times, to 2 times to 1000000 times.

Remember, because of the nature of these OSs, the time it takes to do  
an operation can vary and sometimes take much longer than usual.   
Time several times to get the feel for the time.

Drop me a note if you want an early look.

Dar Scott
dsc at swcp.com



More information about the use-livecode mailing list