Skip to content

Timer support #607

Open
Open
@awvwgk

Description

@awvwgk

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.

Activity

added
topic: utilitiescontainers, strings, files, OS/environment integration, unit testing, assertions, logging, ...
ideaProposition of an idea and opening an issue to discuss it
on Dec 20, 2021
ivan-pi

ivan-pi commented on Dec 20, 2021

@ivan-pi
Member

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

nncarlson commented on Dec 21, 2021

@nncarlson
Contributor

Another timer implementation here.

urbanjost

urbanjost commented on Dec 21, 2021

@urbanjost

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

trippalamb commented on Apr 7, 2022

@trippalamb

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    ideaProposition of an idea and opening an issue to discuss ittopic: utilitiescontainers, strings, files, OS/environment integration, unit testing, assertions, logging, ...

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @trippalamb@nncarlson@ivan-pi@awvwgk@urbanjost

        Issue actions

          Timer support · Issue #607 · fortran-lang/stdlib