Summary: This patch implements `clock_gettime` using the monotonic clock. This allows users to get time elapsed at nanosecond resolution. This is primarily to facilitate compiling the `chrono` library from `libc++`. For this reason we provide both `CLOCK_MONOTONIC`, which we can implement with the GPU's global fixed-frequency clock, and `CLOCK_REALTIME` which we cannot. The latter is provided just to make people who use this header happy and it will always return failure.
20 lines
615 B
Modula-2
20 lines
615 B
Modula-2
//===-- C standard library header time.h ----------------------------------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_LIBC_TIME_H
|
|
#define LLVM_LIBC_TIME_H
|
|
|
|
#include "__llvm-libc-common.h"
|
|
#include "llvm-libc-macros/time-macros.h"
|
|
#include "llvm-libc-types/clock_t.h"
|
|
#include "llvm-libc-types/clockid_t.h"
|
|
|
|
%%public_api()
|
|
|
|
#endif // LLVM_LIBC_TIME_H
|