[flang-commits] [flang] [llvm] [flang][flang-rt] Add support for non-standard TIMEF intrinsic (PR #185377)

Tarun Prabhu via flang-commits flang-commits at lists.llvm.org
Wed Apr 22 07:47:19 PDT 2026


================
@@ -1233,6 +1233,23 @@ PROGRAM example_time
 END PROGRAM
 ```
 
+### Non-Standard Intrinsics: TIMEF
+
+#### Description
+`TIMEF` returns the number of seconds that have elapsed since the first time TIMEF was called.
+The first time it is called, TIMEF returns 0.
+
+By default, the behaviour matches that of ifort and classic-flang compilers. To match 
+behaviour of compilers like XLF and nvfortran, use `export FLANG_TIMEF_IN_MILLISECONDS=1` to 
+ensure TIMEF returns number of milliseconds elapsed since the first time TIMEF() was called.
+
----------------
tarunprabhu wrote:

```suggestion
By default, the behaviour matches that of ifort and classic-flang. To match the
behaviour of XLF and nvfortran, set ` FLANG_TIMEF_IN_MILLISECONDS=1` in your environment. This will cause 
`TIMEF` to return the number of milliseconds elapsed since the first time `TIMEF` was called.

```

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


More information about the flang-commits mailing list