kernel: Add helpers for converting durations into milliseconds
These should help to make it easier to understand code passing specific durations to the kernel APIs. Change-Id: I8682fafc291e8af56fd0289d0cab8c736b88da59 Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
22a75145ef
commit
1447169c4b
1 changed files with 6 additions and 0 deletions
|
@ -496,6 +496,12 @@ extern void *k_thread_custom_data_get(void);
|
|||
|
||||
#include <sys_clock.h>
|
||||
|
||||
/* Convenience helpers to convert durations into milliseconds */
|
||||
#define K_MSEC(ms) (ms)
|
||||
#define K_SECONDS(s) K_MSEC((s) * MSEC_PER_SEC)
|
||||
#define K_MINUTES(m) K_SECONDS((m) * 60)
|
||||
#define K_HOURS(h) K_MINUTES((h) * 60)
|
||||
|
||||
/* private internal time manipulation (users should never play with ticks) */
|
||||
|
||||
/* added tick needed to account for tick in progress */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue