[m-dev.] sleep

Ben Mellor bmellor at csse.unimelb.edu.au
Mon Mar 2 16:42:07 AEDT 2009


Hi

Do people think the following would be useful enough to put in the standard
library?



:- impure pred sleep(int::in) is det.

:- pred sleep(int::in, io::di, io::uo) is det.

:- pragma promise_pure(sleep/3).
sleep(Seconds, !IO) :-
    impure sleep(Seconds).

:- pragma foreign_proc("C",
    sleep(Seconds::in),
    [will_not_call_mercury, thread_safe],
"
    sleep(Seconds);
").
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at csse.unimelb.edu.au
Administrative Queries: owner-mercury-developers at csse.unimelb.edu.au
Subscriptions:          mercury-developers-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the developers mailing list