// Copyright 2024 The IREE Authors
//
// Licensed 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 IREE_BASE_INTERNAL_TIME_H_
#define IREE_BASE_INTERNAL_TIME_H_

#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif  // __cplusplus

// Returns monotonically increasing time in nanoseconds.
// The epoch is arbitrary (typically system boot) and values are only meaningful
// relative to other timestamps from the same process.
//
// Implementations:
//   POSIX (Linux/Android/Apple/Wasm): CLOCK_MONOTONIC
//   Windows: QueryPerformanceCounter
//
// Also available to other libraries under base/ to avoid circular dependencies.
int64_t iree_platform_time_now(void);

#ifdef __cplusplus
}  // extern "C"
#endif  // __cplusplus

#endif  // IREE_BASE_INTERNAL_TIME_H_
