Skip to content

juanmanzanero/Stopwatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Stopwatch

Fortran code: Stopwatch class to measure computation times.

This class is a stopwatch to measure computation times. It handles multiple simultaneous events, and allows for pausing and resetting each one individually. It measures both the elapsed time, and the total CPU time (different when computing in parallel). This program can be invoked from other source files by using the module StopwatchClass

program main
use StopwatchClass
...

The user just interacts with the Stopwatch class. The process to measure times is:

  1. Create an event. Each event is identified by a name (character)
call Stopwatch % CreateNewEvent("EventName")
  1. Start the event:
call Stopwatch % Start("EventName")
  1. Pause the event:
call Stopwatch % Pause("EventName")
  1. Get the times:
call Stopwatch % ElapsedTime("EventName")
call Stopwatch % CPUTime("EventName")
  1. Reset the event (if desired):
call Stopwatch % Reset("EventName")

NOTE: The time can be measured while the event is running. It just takes a measure of the actual time and compares it to the previous register.

About

Fortran code: Stopwatch class to measure computation times.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published