41 NDB_TICKS elapsedTime();
42 void printTransactionStatistics(
const char* text,
45 void printTestTimer(
int numLoops,
47 void printTotalTime(
void);
53 inline NdbTimer::NdbTimer(){
57 inline void NdbTimer::doReset(
void){
62 inline void NdbTimer::doStart(
void){
63 startTime = NdbTick_CurrentMillisecond();
66 inline void NdbTimer::doStop(
void){
67 stopTime = NdbTick_CurrentMillisecond();
70 inline NDB_TICKS NdbTimer::elapsedTime(
void){
71 return (stopTime - startTime);
74 inline void NdbTimer::printTransactionStatistics(
const char* text,
79 Uint32 lapTime = (Uint32)elapsedTime();
80 ndbout_c(
"%i transactions, %i %s total time = %d ms\nAverage %f ms/transaction, %f ms/%s.\n%f transactions/second, %f %ss/second.\n",
81 numTransactions, numTransactions*numOperations, text, lapTime,
82 ((
double)lapTime/numTransactions), ((
double)lapTime/(numTransactions*numOperations)), text,
83 1000.0/((
double)lapTime/numOperations), 1000.0/((
double)lapTime/(numTransactions*numOperations)), text);
88 inline void NdbTimer::printTestTimer(
int numLoops,
91 Uint32 lapTime = (Uint32)elapsedTime();
92 ndbout_c(
"%i loop * %i records, total time = %d ms\nAverage %f ms/loop, %f ms/record.\n%f looop/second, %f records/second.\n",
93 numLoops, numRecords, lapTime,
94 ((
double)lapTime/numLoops), ((
double)lapTime/(numLoops*numRecords)),
95 1000.0/((
double)lapTime/numLoops), 1000.0/((
double)lapTime/(numLoops*numRecords)));
99 inline void NdbTimer::printTotalTime(
void){
101 Uint32 lapTime = (Uint32)elapsedTime();
102 Uint32 secTime = lapTime/1000;
103 ndbout_c(
"Total time : %d seconds (%d ms)\n", secTime, lapTime);