diff options
| author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2016-07-20 07:40:47 -0400 |
|---|---|---|
| committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2016-07-20 07:42:41 -0400 |
| commit | 98510c506a16b2a444eb6615ec8d78bc7c64e0aa (patch) | |
| tree | 5e22518db1c73d6edf91f83c1ce8850403ec0092 /include | |
| parent | 7ae970e73bc1d026bbf65a82c066aab79c860fe8 (diff) | |
Add litmus_clock() helper
Convenient wrapper for CLOCK_MONOTONIC -> lt_t.
Diffstat (limited to 'include')
| -rw-r--r-- | include/litmus.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/litmus.h b/include/litmus.h index 751b5ec..0f0929b 100644 --- a/include/litmus.h +++ b/include/litmus.h | |||
| @@ -340,6 +340,14 @@ int lt_sleep(lt_t timeout); | |||
| 340 | */ | 340 | */ |
| 341 | void lt_sleep_until(lt_t wake_up_time); | 341 | void lt_sleep_until(lt_t wake_up_time); |
| 342 | 342 | ||
| 343 | /** Get the current time used by the LITMUS^RT scheduler. | ||
| 344 | * This is just CLOCK_MONOTONIC and hence the same | ||
| 345 | * as monotime(), but the result is given in nanoseconds | ||
| 346 | * as a value of type lt_t. | ||
| 347 | * @return CLOCK_MONOTONIC time in nanoseconds | ||
| 348 | */ | ||
| 349 | lt_t litmus_clock(void); | ||
| 350 | |||
| 343 | /** | 351 | /** |
| 344 | * Obtain CPU time consumed so far | 352 | * Obtain CPU time consumed so far |
| 345 | * @return CPU time in seconds | 353 | * @return CPU time in seconds |
