Precisely what are you trying to measure?
If you just want elapsed test time in seconds, you can use the ANSI C time() and difftime() functions to do this.
This is pretty simple to do, something like this will work:
void show_elapsed_time (time_t TestStart)
{
// Call to calculate and display elapsed test time
int hours, minutes, seconds;
char time_str[10];
time_t now, elapsed;
time (&now);
elapsed = difftime (now, TestStart);
hours = (int) (elapsed / 3600);
elapsed -= (hours * 3600);
minutes = (int) (elapsed / 60);
seconds = (int) (elapsed - (minutes * 60));
sprintf (time_str, "%0d:%0d:%0d", hours, minutes, seconds);
SetCtrlVal (mainpanel, MAINPANEL_TEST_TIME, time_str);
}
If you want to determine execution time for a block of code, that is more difficult. You can do it with SDK functions. If you want the SDK functions you will need to get the full development version of CVI. You can download a generic version of the Platform SDK directly from MSDN but it will not have the special tweaks that NI has added to the CVI version and probably won't be worth the time and effort you would have to put into using it.
Martin Fredrickson
Test Engineer
Northrop Grumman
Advanced Systems and Products
San Diego, CA 92128