tagged-timers: Simple wrappers for timing IO actions (single-threaded)

[ library, mit, system ] [ Propose Tags ]

Library for tagging IO actions and getting logs of total time spent per tag.


[Skip to Readme]

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0
Dependencies base (>=4.8 && <4.9), time (>=1.5 && <1.6), transformers (>=0.4 && <0.5), unordered-containers [details]
License MIT
Author Ranjit Jhala
Maintainer jhala@cs.ucsd.edu
Category System
Home page http://github.com/ucsd-progsys/tagged-timers
Source repo head: git clone http://github.com/ucsd-progsys/tagged-timers.git
Uploaded by ranjitjhala at 2016-03-20T04:48:11Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 797 total (6 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2016-03-20 [all 1 reports]

Readme for tagged-timers-0.1.0.0

[back to package description]

README

tagged-timers is a simple package for timing different IO that occur within a program and grouping the results according to dynamically generated String tags.

Example

For a simple example of usage, see examples/Example.hs

main :: IO ()
main = do
  t <- T.create
  T.time t "cat" (act "cat" 5)
  T.time t "dog" (act "dog" 2)
  r <- T.result t
  putStrLn $ "Time Result: " ++ show r

which, when executed, yields the following behavior:

Prelude> :l examples/Example.hs
...
*Main> main
Starting action cat
Oh so sleepy...
(5 seconds later)
Finished action cat
Starting action dog
Oh so sleepy...
(2 seconds later)
Finished action dog
Time Result: [("cat",5.003739s),("dog",2.003825s)]