Performance Timing
Simon Marlow
simonmar@microsoft.com
Thu, 27 Mar 2003 16:12:54 -0000
> timer f a =3D do
> t1 <- get current time
> evaluate (f a)
> t2 <- get current time
> return (different in t2 and t1)
>=20
> where evaluate is from Control.Exception. could someone tell me how
> evaluate compares to seq and deepSeq?
The documentation explains the difference, but it's a bit cryptic.
Informally: 'evaluate e' is an IO action that, when performed, forces e
to weak-head normal form. It's a kind of seq that you can use in the IO
monad.
Cheers,
Simon