UNIX_TIME taking too much time#208
Merged
Bruno02468 merged 1 commit intoMystranSolver:devfrom Apr 8, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fortran does not provide a way to get the current UNIX timestamp. MYSTRAN has a custom subroutine called
UNIX_TIMEthat computes it fromDATE_AND_TIME. A thing of beauty, yes, but it is also 500 times slower than C'stime().This update adds
.f03files to the build script, renamesUNIX_TIME.f90toUNIX_TIME.f03to signal its Fortran 2003-ness, and rewroteUNIX_TIMEto useISO_C_BINDINGto calllibc'stime()function.Result: the time spent getting the time went from ~15% to nothing.
I don't know how to feel about this. The Fortran 2003 cat is officially out of the bag, though, so that's gotta be good.
Special thanks to @Copper280z for noticing this issue and running the tests!