tmp/tmpso4up4gm/{from.md → to.md}
RENAMED
|
@@ -9,14 +9,14 @@ Objects of class `system_clock` represent wall clock time from the
|
|
| 9 |
system-wide realtime clock.
|
| 10 |
|
| 11 |
``` cpp
|
| 12 |
class system_clock {
|
| 13 |
public:
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
static constexpr bool is_steady = unspecified;
|
| 19 |
|
| 20 |
static time_point now() noexcept;
|
| 21 |
|
| 22 |
// Map to C API
|
|
@@ -24,33 +24,35 @@ public:
|
|
| 24 |
static time_point from_time_t(time_t t) noexcept;
|
| 25 |
};
|
| 26 |
```
|
| 27 |
|
| 28 |
``` cpp
|
| 29 |
-
|
| 30 |
```
|
| 31 |
|
| 32 |
*Requires:*
|
| 33 |
`system_clock::duration::min() < system_clock::duration::zero()` shall
|
| 34 |
-
be `true`.
|
|
|
|
|
|
|
| 35 |
|
| 36 |
``` cpp
|
| 37 |
static time_t to_time_t(const time_point& t) noexcept;
|
| 38 |
```
|
| 39 |
|
| 40 |
*Returns:* A `time_t` object that represents the same point in time as
|
| 41 |
`t` when both values are restricted to the coarser of the precisions of
|
| 42 |
-
`time_t` and `time_point`. It is implementation
|
| 43 |
are rounded or truncated to the required precision.
|
| 44 |
|
| 45 |
``` cpp
|
| 46 |
static time_point from_time_t(time_t t) noexcept;
|
| 47 |
```
|
| 48 |
|
| 49 |
*Returns:* A `time_point` object that represents the same point in time
|
| 50 |
as `t` when both values are restricted to the coarser of the precisions
|
| 51 |
-
of `time_t` and `time_point`. It is implementation
|
| 52 |
values are rounded or truncated to the required precision.
|
| 53 |
|
| 54 |
#### Class `steady_clock` <a id="time.clock.steady">[[time.clock.steady]]</a>
|
| 55 |
|
| 56 |
Objects of class `steady_clock` represent clocks for which values of
|
|
@@ -59,14 +61,14 @@ values of `time_point` advance at a steady rate relative to real time.
|
|
| 59 |
That is, the clock may not be adjusted.
|
| 60 |
|
| 61 |
``` cpp
|
| 62 |
class steady_clock {
|
| 63 |
public:
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
static constexpr bool is_steady = true;
|
| 69 |
|
| 70 |
static time_point now() noexcept;
|
| 71 |
};
|
| 72 |
```
|
|
@@ -78,14 +80,14 @@ shortest tick period. `high_resolution_clock` may be a synonym for
|
|
| 78 |
`system_clock` or `steady_clock`.
|
| 79 |
|
| 80 |
``` cpp
|
| 81 |
class high_resolution_clock {
|
| 82 |
public:
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
static constexpr bool is_steady = unspecified;
|
| 88 |
|
| 89 |
static time_point now() noexcept;
|
| 90 |
};
|
| 91 |
```
|
|
|
|
| 9 |
system-wide realtime clock.
|
| 10 |
|
| 11 |
``` cpp
|
| 12 |
class system_clock {
|
| 13 |
public:
|
| 14 |
+
using rep = see below;
|
| 15 |
+
using period = ratio<unspecified, unspecified{}>;
|
| 16 |
+
using duration = chrono::duration<rep, period>;
|
| 17 |
+
using time_point = chrono::time_point<system_clock>;
|
| 18 |
static constexpr bool is_steady = unspecified;
|
| 19 |
|
| 20 |
static time_point now() noexcept;
|
| 21 |
|
| 22 |
// Map to C API
|
|
|
|
| 24 |
static time_point from_time_t(time_t t) noexcept;
|
| 25 |
};
|
| 26 |
```
|
| 27 |
|
| 28 |
``` cpp
|
| 29 |
+
using system_clock::rep = unspecified;
|
| 30 |
```
|
| 31 |
|
| 32 |
*Requires:*
|
| 33 |
`system_clock::duration::min() < system_clock::duration::zero()` shall
|
| 34 |
+
be `true`.
|
| 35 |
+
|
| 36 |
+
[*Note 1*: This implies that `rep` is a signed type. — *end note*]
|
| 37 |
|
| 38 |
``` cpp
|
| 39 |
static time_t to_time_t(const time_point& t) noexcept;
|
| 40 |
```
|
| 41 |
|
| 42 |
*Returns:* A `time_t` object that represents the same point in time as
|
| 43 |
`t` when both values are restricted to the coarser of the precisions of
|
| 44 |
+
`time_t` and `time_point`. It is *implementation-defined* whether values
|
| 45 |
are rounded or truncated to the required precision.
|
| 46 |
|
| 47 |
``` cpp
|
| 48 |
static time_point from_time_t(time_t t) noexcept;
|
| 49 |
```
|
| 50 |
|
| 51 |
*Returns:* A `time_point` object that represents the same point in time
|
| 52 |
as `t` when both values are restricted to the coarser of the precisions
|
| 53 |
+
of `time_t` and `time_point`. It is *implementation-defined* whether
|
| 54 |
values are rounded or truncated to the required precision.
|
| 55 |
|
| 56 |
#### Class `steady_clock` <a id="time.clock.steady">[[time.clock.steady]]</a>
|
| 57 |
|
| 58 |
Objects of class `steady_clock` represent clocks for which values of
|
|
|
|
| 61 |
That is, the clock may not be adjusted.
|
| 62 |
|
| 63 |
``` cpp
|
| 64 |
class steady_clock {
|
| 65 |
public:
|
| 66 |
+
using rep = unspecified;
|
| 67 |
+
using period = ratio<unspecified, unspecified{}>;
|
| 68 |
+
using duration = chrono::duration<rep, period>;
|
| 69 |
+
using time_point = chrono::time_point<unspecified, duration>;
|
| 70 |
static constexpr bool is_steady = true;
|
| 71 |
|
| 72 |
static time_point now() noexcept;
|
| 73 |
};
|
| 74 |
```
|
|
|
|
| 80 |
`system_clock` or `steady_clock`.
|
| 81 |
|
| 82 |
``` cpp
|
| 83 |
class high_resolution_clock {
|
| 84 |
public:
|
| 85 |
+
using rep = unspecified;
|
| 86 |
+
using period = ratio<unspecified, unspecified{}>;
|
| 87 |
+
using duration = chrono::duration<rep, period>;
|
| 88 |
+
using time_point = chrono::time_point<unspecified, duration>;
|
| 89 |
static constexpr bool is_steady = unspecified;
|
| 90 |
|
| 91 |
static time_point now() noexcept;
|
| 92 |
};
|
| 93 |
```
|