MCPcopy Create free account
hub / github.com/dds-bridge/dds / print_basic

Method print_basic

library/tests/TestTimer.cpp:94–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92
93
94void TestTimer::print_basic() const
95{
96 if (count_ == 0)
97 return;
98
99 if (name_ != "")
100 cout << setw(19) << left << "Timer name" << ": " << name_ << "\n";
101
102 cout << setw(19) << left << "Number of calls" << ": " << count_ << "\n";
103
104 if (user_cum_ == 0)
105 cout << setw(19) << left << "User time" << ": " << "zero" << "\n";
106 else
107 {
108 cout << setw(19) << left << "User time/ticks" << ": " <<
109 user_cum_ << "\n";
110 cout << setw(19) << left << "User per call" << ": " <<
111 setprecision(2) << user_cum_ / static_cast<float>(count_) << "\n";
112 }
113
114 if (sys_cum_ == 0)
115 cout << setw(19) << left << "Sys time (ms)" << ": " << "zero" << "\n";
116 else
117 {
118 cout << setw(19) << left << "Sys time/ticks" << ": " <<
119 sys_cum_ << "\n";
120 cout << setw(19) << left << "Sys per call" << ": " <<
121 setprecision(2) << sys_cum_ / static_cast<float>(count_) << "\n";
122 if (user_cum_ > 0) {
123 cout << setw(19) << left << "Ratio" << ": " <<
124 setprecision(2) << sys_cum_ / static_cast<float>(user_cum_);
125 }
126 }
127 cout << endl;
128}
129
130
131void TestTimer::print_hands() const

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected