| 129 | |
| 130 | |
| 131 | void TestTimer::print_hands() const |
| 132 | { |
| 133 | if (name_ != "") |
| 134 | cout << setw(21) << left << "Timer name" << |
| 135 | setw(12) << right << name_ << "\n"; |
| 136 | |
| 137 | cout << setw(21) << left << "Number of hands" << |
| 138 | setw(12) << right << count_ << "\n"; |
| 139 | |
| 140 | if (count_ == 0) |
| 141 | return; |
| 142 | |
| 143 | if (user_cum_ == 0) |
| 144 | cout << setw(21) << left << "User time (ms)" << |
| 145 | setw(12) << right << "zero" << "\n"; |
| 146 | else |
| 147 | { |
| 148 | cout << setw(21) << left << "User time (ms)" << |
| 149 | setw(12) << right << fixed << |
| 150 | setprecision(0) << user_cum_ << "\n"; |
| 151 | cout << setw(21) << left << "Avg user time (ms)" << |
| 152 | setw(12) << right << fixed << setprecision(2) << user_cum_ / |
| 153 | static_cast<float>(count_) << "\n"; |
| 154 | } |
| 155 | |
| 156 | if (sys_cum_ == 0) |
| 157 | cout << setw(21) << left << "Sys time (ms)" << |
| 158 | setw(12) << right << "zero" << "\n"; |
| 159 | else |
| 160 | { |
| 161 | cout << setw(21) << left << "Sys time (ms)" << |
| 162 | setw(12) << right << fixed << setprecision(0) << sys_cum_ << "\n"; |
| 163 | cout << setw(21) << left << "Avg sys time (ms)" << |
| 164 | setw(12) << right << fixed << setprecision(2) << sys_cum_ / |
| 165 | static_cast<float>(count_) << "\n"; |
| 166 | if (user_cum_ > 0) { |
| 167 | cout << setw(21) << left << "Ratio" << |
| 168 | setw(12) << right << fixed << setprecision(2) << |
| 169 | sys_cum_ / static_cast<float>(user_cum_); |
| 170 | } |
| 171 | } |
| 172 | cout << endl; |
| 173 | } |
| 174 | |