home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.hitl.washington.edu
/
ftp.hitl.washington.edu.tar
/
ftp.hitl.washington.edu
/
pub
/
people
/
habib
/
kodak
/
frame_rate.cc~
< prev
next >
Wrap
Text File
|
2000-04-18
|
735b
|
38 lines
#include "frame_rate.h"
ClassFrameRate::ClassFrameRate()
{
counter_time = 0;
}
void ClassFrameRate::PrintAverageFR(int marra)
{
if (counter_time == 0){
start = clock();
counter_time++;
} else
if (counter_time == marra) {
finish = clock();
cout << "Frame Rate = " <<(double) marra * (double) CLOCKS_PER_SEC / (double) (finish-start) << endl;
counter_time = 0;
} else
counter_time++;
}
float ClassFrameRate::GetElapsedTime(int marra, float time)
{
if (counter_time2 == 0){
start2 = clock();
counter_time2++;
} else
if (counter_time2 == marra) {
finish2 = clock();
counter_time2 = 0;
return (float) ((finish2-start2)/(float) CLOCKS_PER_SEC)/(float) marra;
} else
counter_time2++;
return time;
}