PDA

View Full Version : Time to make a snap



Toan
March 15, 2007, 17:33:35
How can I know. How much time the program takes to make a snap image?

Stefan Geissler
March 15, 2007, 17:45:14
Hi Toan,

You may use following code:



__int64 start;
__int64 end;
__int64 freq;
QueryPerformanceCounter( (LARGE_INTEGER*) (&start) );

Grabber.SnapImage();

QueryPerformanceCounter( (LARGE_INTEGER*) (&end) );
QueryPerformanceFrequency( (LARGE_INTEGER*) (&freq) );
printf( "Time for run: %f\n", ( double )( end-start ) / (double) freq );