time.h 762 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <Kernel/API/POSIX/sys/types.h>
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. #define CLOCKS_PER_SEC 1000
  12. struct timespec {
  13. time_t tv_sec;
  14. long tv_nsec;
  15. };
  16. typedef int clockid_t;
  17. enum {
  18. CLOCK_REALTIME,
  19. #define CLOCK_REALTIME CLOCK_REALTIME
  20. CLOCK_MONOTONIC,
  21. #define CLOCK_MONOTONIC CLOCK_MONOTONIC
  22. CLOCK_MONOTONIC_RAW,
  23. #define CLOCK_MONOTONIC_RAW CLOCK_MONOTONIC_RAW
  24. CLOCK_REALTIME_COARSE,
  25. #define CLOCK_REALTIME_COARSE CLOCK_REALTIME_COARSE
  26. CLOCK_MONOTONIC_COARSE,
  27. #define CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC_COARSE
  28. CLOCK_ID_COUNT,
  29. };
  30. #define TIMER_ABSTIME 99
  31. #ifdef __cplusplus
  32. }
  33. #endif