
25 Jul
2010
25 Jul
'10
12:30 p.m.
On Sat, 24 Jul 2010 22:09:15 +0200, Alex Rozenshteyn
I'm trying to write a simple timer application (mostly to learn gui programming), and I'd like it to display 1/100ths of a second. I know I can fake this with threadDelay, but I was wondering if there's a way to get current time to more precision than one second.
That depends on the type of GUI you are using, of course. If you use wxHaskell, you can do it like this:
t <- timer f [ interval := 10 , on command := repaint ]
where f is the frame handle; you don't need to use t anywhere. The interval is defined in milliseconds. Regards, Henk-Jan van Tuyl -- http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html --