diff --git a/CPP11.md b/CPP11.md index 431eb57..34c2d59 100644 --- a/CPP11.md +++ b/CPP11.md @@ -652,10 +652,10 @@ baz(p1); ### std::chrono The chrono library contains a set of utility functions and types that deal with _durations_, _clocks_, and _time points_. One use case of this library is benchmarking code: ```c++ -std::chrono::time_point start, end; -start = std::chrono::system_clock::now(); +std::chrono::time_point start, end; +start = std::chrono::steady_clock::now(); // Some computations... -end = std::chrono::system_clock::now(); +end = std::chrono::steady_clock::now(); std::chrono::duration elapsed_seconds = end-start; diff --git a/README.md b/README.md index f7e5515..85f5760 100644 --- a/README.md +++ b/README.md @@ -1201,10 +1201,10 @@ baz(p1); ### std::chrono The chrono library contains a set of utility functions and types that deal with _durations_, _clocks_, and _time points_. One use case of this library is benchmarking code: ```c++ -std::chrono::time_point start, end; -start = std::chrono::system_clock::now(); +std::chrono::time_point start, end; +start = std::chrono::steady_clock::now(); // Some computations... -end = std::chrono::system_clock::now(); +end = std::chrono::steady_clock::now(); std::chrono::duration elapsed_seconds = end-start;