replace tabs space
git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@334 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
parent
570f0ed652
commit
7fe4c81ff0
28 changed files with 799 additions and 778 deletions
|
@ -25,56 +25,59 @@ class Timer
|
|||
{
|
||||
public:
|
||||
|
||||
Timer()
|
||||
{
|
||||
t100 = 0;
|
||||
};
|
||||
Timer()
|
||||
{
|
||||
t100 = 0;
|
||||
};
|
||||
|
||||
void start()
|
||||
{
|
||||
t0 = clock();
|
||||
}
|
||||
{
|
||||
t0 = clock();
|
||||
}
|
||||
|
||||
void stop()
|
||||
{
|
||||
t1 = clock();
|
||||
}
|
||||
|
||||
int t()
|
||||
{
|
||||
return t1-t0;
|
||||
}
|
||||
{
|
||||
t1 = clock();
|
||||
}
|
||||
|
||||
int t()
|
||||
{
|
||||
return t1-t0;
|
||||
}
|
||||
|
||||
double sec(int t)
|
||||
{
|
||||
return floor(100.0*double(t)/1000.0 )/100.0;
|
||||
}
|
||||
|
||||
int rel(int t)
|
||||
{
|
||||
return ( t100==0 ? 100 : (int) floor(100.0*t/t100+0.5) );
|
||||
}
|
||||
|
||||
double speedup(int t)
|
||||
{
|
||||
double tup=t;
|
||||
return (tup!=0 ? floor(100.0*(t100!=0?t100:tup)/tup+0.5)/100 : 1);
|
||||
}
|
||||
double sec(int t)
|
||||
{
|
||||
return floor(100.0*double(t)/1000.0 )/100.0;
|
||||
}
|
||||
|
||||
int rel(int t)
|
||||
{
|
||||
return ( t100==0 ? 100 : (int) floor(100.0*t/t100+0.5) );
|
||||
}
|
||||
|
||||
double speedup(int t)
|
||||
{
|
||||
double tup=t;
|
||||
return (tup!=0 ? floor(100.0*(t100!=0?t100:tup)/tup+0.5)/100 : 1);
|
||||
}
|
||||
|
||||
double t100;
|
||||
double t100;
|
||||
|
||||
void print(int t, const char* s)
|
||||
{
|
||||
void print(int t, const char* s)
|
||||
{
|
||||
std::cout << s << "\tseconds: " << sec(t) << "\trelative time: " << rel(t) << "%\tspeed-up factor: " << speedup(t) << "" << std::endl;
|
||||
}
|
||||
}
|
||||
private:
|
||||
int t0;
|
||||
int t1;
|
||||
int t1;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
// $Log$
|
||||
// Revision 1.5 2005/10/30 14:03:23 syntheticpp
|
||||
// replace tabs space
|
||||
//
|
||||
// Revision 1.4 2005/10/26 00:38:49 rich_sposato
|
||||
// Added CVS keywords and header lines.
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue