You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also made the result of the clock testing clearer so that one can see
the result for each clock test when compiling the header file.
Signed-off-by: Ted Lyngmo <ted@lyncon.se>
Copy file name to clipboardExpand all lines: README.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,9 +15,9 @@ make
15
15
staticconstexprclockid_t clock_id;
16
16
17
17
// If this clock can use TIMER_ABSTIME in clock_nanosleep:
18
-
staticconstexprboolcan_sleep_until_abstime;
18
+
staticconstexprboolcan_clock_nanosleep;
19
19
```
20
-
While the "steadyness" of each clock is hardcoded in the recipe file, if the clock can sleep until an absolute time is determined while generating the header file. Drop-in replacement functions for `std::this_thread::sleep_for` and `std::this_thread::sleep_until` are available in `lyn::this_thread` that sleeps until an absolute time if the clock supports it. Note that `lyn::this_thread::sleep_for` has a `Clock` template parameter that can be used to specify what clock to use for sleeping.
20
+
While the "steadyness" of each clock is hardcoded in the recipe file, if the clock can use `clock_nanosleep`is determined while generating the header file. Drop-in replacement functions for `std::this_thread::sleep_for` and `std::this_thread::sleep_until` are available in `lyn::this_thread` that sleeps until an absolute time if the clock supports `clock_nanosleep`. Note that `lyn::this_thread::sleep_for` has a `Clock` template parameter that can be used to specify what clock to use for sleeping.
21
21
```c++
22
22
template<classClock = std::chrono::steady_clock, class Rep, class Period>
**Note:** The header file will only function correctly when used on the platform where it was generated. Cross-compilation is not supported. Create the file on each individual platform where you want it.
29
+
**Note:** The header file will only function correctly when used on the platform for which it was generated. Create the file for each individual platform where you want it. If your code is supposed to work on multiple platforms, select clocks that exists on all of them. Do not copy a generated `clocxx.hpp` file generated for one platform to another platform. Time as you know it may come to an end.
Copy file name to clipboardExpand all lines: seen_clockid_t
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -21,3 +21,5 @@ CLOCK_BOOTTIME_ALARM, true, Like CLOCK_BOOTTIME. See timer_create(2) for further
21
21
CLOCK_PROCESS_CPUTIME_ID, true, This is a clock that measures CPU time consumed by this process (i.e., CPU time consumed by all threads in the process). On Linux, this clock is not settable.
22
22
23
23
CLOCK_THREAD_CPUTIME_ID, true, This is a clock that measures CPU time consumed by this thread. On Linux, this clock is not settable.
24
+
25
+
CLOCK_SOFTTIME, false, This clock (a QNX Neutrino extension) is active only when the processor isn't in a power-saving mode. For example, an application using a CLOCK_SOFTTIME timer to sleep wouldn't wake up the processor when the application was due to wake up. This will allow the processor to enter a power-saving mode.
0 commit comments