[flang-commits] [flang] [Flang][runtime] Distinguish CPU time and elapsed time for cpu_time and system_clock (PR #96652)

Michael Klemm via flang-commits flang-commits at lists.llvm.org
Fri Jun 28 07:51:57 PDT 2024


mjklemm wrote:

Alrighty then.  Let me see if I can remove the `std::chrono` stuff.

> > I am bit worried about the C++ runtime dependency that this could bring if `std::chrono::high_resolution_clock` is not header only in some C++ standard library. Did check that? Could you add a system_clock test in `test/Runtime/no-cpp-dep.c`?
> 
> Yeah, using chrono related stuff has always ended up with some dependency. Most recently it came in as part of Sleep and it was removed in #84911.

We now have two implementations

- one based on `std::timespec_get` as the fallback
- one based on `clock_gettime`

I have also done some mild refactoring of the code to slightly reduce duplication due to my changes.

What do y'all think?

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


More information about the flang-commits mailing list