Here's a POSIX implementation of a sleep function in C, as found in the book "Advanced Programming in the UNIX Environment":

    http://www.yendor.com/programming/unix/apue/lib.svr4/sleep.c

AFAIK, all the GHC platforms, including Windows, are POSIX compliant.  You could compile this code separately and call it via the FFI.  If it doesn't work on Windows, you could instead call:
Win32::Sleep(TIME) 

[CORE] Pauses for TIME milliseconds. The timeslices are made available to other processes and threads.

Hope that helps,
Lyle Kopnicky

BTW, you have a very interesting disclaimer in your message.  I hope I will not go to jail for reading it.


[EMAIL PROTECTED] wrote:
Hi there,

In Ghc, how do I sleep for say, 1 minute? I'm trying to write a simple file
arrival listener and could not find the sleep api. Can haskell do it at
all?

Thanks.

Ben.


This message is intended only for the addressee and may contain information
that is confidential or privileged. Unauthorized use is strictly prohibited
and may be unlawful. If you are not the intended recipient, or the person
responsible for delivering to the intended recipient, you should not read,
copy, disclose or otherwise use this message, except for the purpose of
delivery to the addressee. If you have received this email in error, please
delete and advise us immediately.


_______________________________________________
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell
  
_______________________________________________
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to