LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Measuring Sequence Commands Time

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 ?

-----------------------------------------
Kobi Kalif
Software Engineer

0 Kudos
Message 1 of 4
(3,093 Views)

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...

 

0 Kudos
Message 2 of 4
(3,092 Views)

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 ?

-----------------------------------------
Kobi Kalif
Software Engineer

0 Kudos
Message 3 of 4
(3,090 Views)

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

0 Kudos
Message 4 of 4
(3,086 Views)