#include "sw.h"
|
|
SW (std::string description) |
|
void |
start (void) |
|
void |
stop (void) |
|
|
~SW () |
|
|
SW (std::string description) |
|
void |
start (void) |
|
void |
stop (void) |
|
|
~SW () |
|
|
SW (std::string description) |
|
void |
start (void) |
|
void |
stop (void) |
|
|
~SW () |
|
SW() [1/3]
SW::SW |
( |
std::string |
description
|
) |
|
|
inline
|
47 : n (0), sum (0), sum2 (0), m_min ((uint64_t) -1), m_max (0), description (description)
~SW() [1/3]
92double units = 1000000000;
93const double average = n ? (double) sum / units / n : 0.0;
94const double standardDeviation =
95 n > 2 ? std::sqrt (((
double) sum2 / units / units - (
double) sum / units * sum / units / n) / (n - 1)) : 0.0;
96const double m_minimum = n ? (double) m_min / units : 0.0;
97const double m_maximum = (double) m_max / units;
98const double total = (double) sum / units;
102 cout << fixed << setprecision(9);
103 cout << (double) average <<
" +/- " << standardDeviation <<
" [" << m_minimum <<
", " << m_maximum <<
"], n: " << setw(4) << n
104 <<
", total: " << total <<
", " << description << endl;
SW() [2/3]
SW::SW |
( |
std::string |
description
|
) |
|
|
inline
|
47 : n (0), sum (0), sum2 (0), m_min ((uint64_t) -1), m_max (0), description (description)
~SW() [2/3]
92double units = 1000000000;
93const double average = n ? (double) sum / units / n : 0.0;
94const double standardDeviation =
95 n > 2 ? std::sqrt (((
double) sum2 / units / units - (
double) sum / units * sum / units / n) / (n - 1)) : 0.0;
96const double m_minimum = n ? (double) m_min / units : 0.0;
97const double m_maximum = (double) m_max / units;
98const double total = (double) sum / units;
102 cout << fixed << setprecision(9);
103 cout << (double) average <<
" +/- " << standardDeviation <<
" [" << m_minimum <<
", " << m_maximum <<
"], n: " << setw(4) << n
104 <<
", total: " << total <<
", " << description << endl;
SW() [3/3]
SW::SW |
( |
std::string |
description
|
) |
|
|
inline
|
47 : n (0), sum (0), sum2 (0), m_min ((uint64_t) -1), m_max (0), description (description)
~SW() [3/3]
92double units = 1000000000;
93const double average = n ? (double) sum / units / n : 0.0;
94const double standardDeviation =
95 n > 2 ? std::sqrt (((
double) sum2 / units / units - (
double) sum / units * sum / units / n) / (n - 1)) : 0.0;
96const double m_minimum = n ? (double) m_min / units : 0.0;
97const double m_maximum = (double) m_max / units;
98const double total = (double) sum / units;
102 cout << fixed << setprecision(9);
103 cout << (double) average <<
" +/- " << standardDeviation <<
" [" << m_minimum <<
", " << m_maximum <<
"], n: " << setw(4) << n
104 <<
", total: " << total <<
", " << description << endl;
start() [1/3]
start() [2/3]
58 stamp = std::chrono::high_resolution_clock::now();
start() [3/3]
58 stamp = std::chrono::high_resolution_clock::now();
stop() [1/3]
- Examples
- cpp50Example_main.cpp, and cpp55Example_main.cpp.
70 uint64_t measurement = std::chrono::duration_cast< std::chrono::nanoseconds >
71 (std::chrono::high_resolution_clock::now() - stamp).count ();
73if (measurement > m_max)
77if (measurement < m_min)
82 sum2 += measurement * measurement;
stop() [2/3]
70 uint64_t measurement = std::chrono::duration_cast< std::chrono::nanoseconds >
71 (std::chrono::high_resolution_clock::now() - stamp).count ();
73if (measurement > m_max)
77if (measurement < m_min)
82 sum2 += measurement * measurement;
stop() [3/3]
70 uint64_t measurement = std::chrono::duration_cast< std::chrono::nanoseconds >
71 (std::chrono::high_resolution_clock::now() - stamp).count ();
73if (measurement > m_max)
77if (measurement < m_min)
82 sum2 += measurement * measurement;
The documentation for this class was generated from the following file: