07-07-2011 08:50 AM
Hi ,
I want to test how much time it takes to my functions to run each function 3 functions total.
I've tried to use the timer function but with no luck , I Don't want to set a timer control since I'm not working withthreads and going every X (ms) to event will spend me time I don't have.
Any idea's ?
07-07-2011 09:00 AM
Actually I have used a timer callback with a very short interval; using GetTimerTickData on eventData2 then permits to obtain the time elapsed since the last EVENT_TIMER_TICK callback; repeat this procedure for an improved statistics...
07-07-2011 09:09 AM
Hi ,
Yes but my entire test need to be in about 5 ms thats including AO & AI I think it will damage my time.
But i willing to try you mean that i'll set a timer with lets say 0.0001 sec Tick and every tick i will update my golbal timer var ?
07-07-2011 09:30 AM
Well, my times were slower, in the order of a few tens of milliseconds. I have set the time interval at which the timer control callback is called to say 5 ms, a time that should be faster than your process, so the eventdata will reflect the interval of your test.
In the callback of your timer then:
case EVENT_TIMER_TICK:
// do your test here
interval = *( ( double* ) eventData2 );
// in practive you should use an array interval [ i ] and increment i; after finishing say 100 timer events you can calculate the mean interval
You can also use the function GetTimerTickData