24.11 TIMER
It is a utility class it has been coded as BPtimer1 and BPtimer2.
class BPtimer1
{ private : static long t0; static long t1; static long t2; public : static void start() { time(&t0); } static void stop() { t2 = time(&t1) - t0 ; //cout << “time measured = ” << t2 // << “ milliSeconds” << endl ; } static int show() { return t2 ; } } ;
class BPtimer2
{ private : long t0; long t1; long t2; public : void start() { time(&t0); } void stop() { t2 = time(&t1) - t0 ; //cout << “time measured = “ << t2 // << “ milliSeconds” <<endl ; } int show()
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access