Time something real.

This commit is contained in:
Howard Hinnant
2016-07-30 23:15:02 -04:00
parent 151d050391
commit 4e3a40a6dd

View File

@@ -107,12 +107,15 @@ a library such as this.
#include "chrono_io.h"
#include <iostream>
void f();
int
main()
{
using namespace date;
using namespace std::chrono;
auto t0 = steady_clock::now();
f();
auto t1 = steady_clock::now();
std::cout << t1 - t0 << '\n';
}
@@ -126,7 +129,7 @@ for example:
</p>
<blockquote><pre>
104ns
682580ns
</pre></blockquote>
<p>
@@ -136,12 +139,13 @@ different units on your platform), and the output automatically changes units fo
<blockquote><pre>
auto t0 = system_clock::now();
f();
auto t1 = system_clock::now();
std::cout &lt;&lt; t1 - t0 &lt;&lt; '\n';
</pre></blockquote>
<blockquote><pre>
0&micro;s
682&micro;s
</pre></blockquote>
<p>