RE: Performance Timing

2003-03-27 Thread Simon Marlow
> timer f a = do > t1 <- get current time > evaluate (f a) > t2 <- get current time > return (different in t2 and t1) > > 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

Re: Performance Timing

2003-03-27 Thread Hal Daume III
This is in part an answer, in part a question. If 'b' is a "simple value", then somethign like: timer f a = do t1 <- get current time t2 <- f a `seq` get current time return (different in t2 and t1) (my memory of Time fails right now, so fill in the proper functions.) perhaps safer is to

Performance Timing

2003-03-27 Thread Spencer Janssen
I've written two versions of a prime number sieve, and I'm trying to figure out how to performance test them. I've found functions to get the current date and time, and to subtract them, but when I put them in a do notation, I guess the laziness or something, makes the calculation happen first