[libc-commits] [libc] [libc] Baremetal version of clock (PR #146417)

William Huynh via libc-commits libc-commits at lists.llvm.org
Fri Jul 11 03:02:48 PDT 2025


================
@@ -0,0 +1,45 @@
+//===-- Baremetal implementation of the clock function --------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "src/time/clock.h"
+#include "hdr/time_macros.h"
+#include "hdr/types/struct_timespec.h"
+#include "src/__support/CPP/limits.h"
+#include "src/__support/common.h"
+#include "src/__support/macros/config.h"
+#include "src/__support/time/units.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+extern "C" bool __llvm_libc_timespec_get_active(struct timespec *ts);
----------------
saturn691 wrote:

On further thought, I agree with your approach as it is portable.

https://github.com/llvm/llvm-project/pull/146417


More information about the libc-commits mailing list