Petr Hosek b8daa45a56
[libc] Implement timespec_get (#116102)
`timespec_get` is C standard counterpart to POSIX `clock_gettime`. On
Linux we simply use `clock_gettime`. On baremetal we introduce a new
external API `__llvm_libc_timespec_get_utc` that should be implemented
by the vendor.
2024-12-02 14:29:49 -08:00

16 lines
355 B
C

#ifndef LLVM_LIBC_MACROS_TIME_MACROS_H
#define LLVM_LIBC_MACROS_TIME_MACROS_H
#if defined(__AMDGPU__) || defined(__NVPTX__)
#include "gpu/time-macros.h"
#elif defined(__linux__)
#include "linux/time-macros.h"
#endif
#define TIME_UTC 1
#define TIME_MONOTONIC 2
#define TIME_ACTIVE 3
#define TIME_THREAD_ACTIVE 4
#endif // LLVM_LIBC_MACROS_TIME_MACROS_H