[Haskell-cafe] newbie timing question

2007-01-26 Thread Sean McLaughlin
Hello, I'm trying to write a simple function to time an application. -- this doesn't work time f x = do n1 - CPUTime.getCPUTime let res = f x in do n2 - CPUTime.getCPUTime return (res,n2 - n1) On a function that takes 8 seconds to complete, returns (True,4600)

Re: [Haskell-cafe] newbie timing question

2007-01-26 Thread Donald Bruce Stewart
seanmcl: Hello, I'm trying to write a simple function to time an application. -- this doesn't work time f x = do n1 - CPUTime.getCPUTime let res = f x in do n2 - CPUTime.getCPUTime return (res,n2 - n1) On a function that takes 8 seconds to complete,

Re: [Haskell-cafe] newbie timing question

2007-01-26 Thread Spencer Janssen
On Jan 26, 2007, at 4:56 PM, Sean McLaughlin wrote: Hello, I'm trying to write a simple function to time an application. -- this doesn't work time f x = do n1 - CPUTime.getCPUTime let res = f x in do n2 - CPUTime.getCPUTime return (res,n2 - n1) On a function that

Re: [Haskell-cafe] newbie timing question

2007-01-26 Thread Cale Gibbard
On 26/01/07, Sean McLaughlin [EMAIL PROTECTED] wrote: Hello, I'm trying to write a simple function to time an application. -- this doesn't work time f x = do n1 - CPUTime.getCPUTime let res = f x in do n2 - CPUTime.getCPUTime return (res,n2 - n1) On a function