Add chrono

This commit is contained in:
Morten Nobel-Joergensen
2018-07-31 12:06:51 +02:00
parent 06a4584ca2
commit 6b4e0e4439

View File

@@ -511,8 +511,9 @@ auto from = // Get current time_point
// ... do some work // ... do some work
auto to = // Get current time_point auto to = // Get current time_point
high_resolution_clock::now(); high_resolution_clock::now();
using ms = // Compute duration in milliseconds using ms = // Define ms as floating point duration
duration<float, milliseconds::period>; duration<float, milliseconds::period>;
// Compute duration in milliseconds
cout << duration_cast<ms>(to - from) cout << duration_cast<ms>(to - from)
.count() << "ms"; .count() << "ms";
``` ```