mirror of
https://github.com/AnthonyCalandra/modern-cpp-features.git
synced 2025-12-18 02:24:35 +03:00
make std::chrono example more clear (#51)
* make std::chrono example more clear
This commit is contained in:
committed by
Anthony Calandra
parent
b1b0d0e3cc
commit
b0713330f2
2
CPP11.md
2
CPP11.md
@@ -719,7 +719,7 @@ start = std::chrono::steady_clock::now();
|
|||||||
end = std::chrono::steady_clock::now();
|
end = std::chrono::steady_clock::now();
|
||||||
|
|
||||||
std::chrono::duration<double> elapsed_seconds = end - start;
|
std::chrono::duration<double> elapsed_seconds = end - start;
|
||||||
elapsed_seconds.count(); // t number of seconds, represented as a `double`
|
double t = elapsed_seconds.count(); // t number of seconds, represented as a `double`
|
||||||
```
|
```
|
||||||
|
|
||||||
### Tuples
|
### Tuples
|
||||||
|
|||||||
@@ -1305,7 +1305,7 @@ start = std::chrono::steady_clock::now();
|
|||||||
end = std::chrono::steady_clock::now();
|
end = std::chrono::steady_clock::now();
|
||||||
|
|
||||||
std::chrono::duration<double> elapsed_seconds = end - start;
|
std::chrono::duration<double> elapsed_seconds = end - start;
|
||||||
elapsed_seconds.count(); // t number of seconds, represented as a `double`
|
double t = elapsed_seconds.count(); // t number of seconds, represented as a `double`
|
||||||
```
|
```
|
||||||
|
|
||||||
### Tuples
|
### Tuples
|
||||||
|
|||||||
Reference in New Issue
Block a user