Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timer support #607

Open
awvwgk opened this issue Dec 20, 2021 · 4 comments
Open

Timer support #607

awvwgk opened this issue Dec 20, 2021 · 4 comments
Labels
idea Proposition of an idea and opening an issue to discuss it topic: utilities containers, strings, files, OS/environment integration, unit testing, assertions, logging, ...

Comments

@awvwgk
Copy link
Member

awvwgk commented Dec 20, 2021

Support for measuring timings, having timer ranges and pretty printing of time printout would be a useful addition. This is especially helpful for comparing implementation without relying on external tools.

@awvwgk awvwgk added topic: utilities containers, strings, files, OS/environment integration, unit testing, assertions, logging, ... idea Proposition of an idea and opening an issue to discuss it labels Dec 20, 2021
@ivan-pi
Copy link
Member

ivan-pi commented Dec 20, 2021

Some time ago I prototyped some fypp macros for benchmarking. Not sure if they really offer any advantage vs subroutines/functions, but I think I was trying to emulate what Julia has. If I recall correctly Julia timer macros will adjust the number of calls automatically to obtain a decent sample, and then calculate some basic statistics (mean, variance).

A few more links to other timer packages can be found here: fortran-lang/benchmarks#6
The most complete one I've seen is the NIST StopWatch package but it would need a modern update.

On the other hand something more minimalistic could also be useful.

@nncarlson
Copy link
Contributor

Another timer implementation here.

@urbanjost
Copy link

https://github.com/urbanjost/M_stopwatch is a version of StopWatch as an fpm package as well; albeit I use vendor utilities or gprof(1) myself for optimizing, sometimes I want an embedded timer. I found the dynamic loader module particularly interesting at the previously mentioned site; those are nicely done and look like they would be nice additions to the fpm(1) registry. At a minimum those should be added to the Fortran Wiki site.

@trippalamb
Copy link

I might be missing something, but does the System_Clock() internal not already support this basic functionality?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea Proposition of an idea and opening an issue to discuss it topic: utilities containers, strings, files, OS/environment integration, unit testing, assertions, logging, ...
Projects
None yet
Development

No branches or pull requests

5 participants