This commit is contained in:
Ingy döt Net 2013-10-27 22:24:23 +00:00
parent 6f050a029e
commit 776bba907c
3887 changed files with 59894 additions and 7280 deletions

View file

@ -0,0 +1,9 @@
o_text("Sleeping...\n");
# Sleep X seconds
sleep(atoi(argv(1)));
# Sleep X microseconds
#usleep(atoi(argv(1)));
o_text("Awake!\n");

View file

@ -0,0 +1,4 @@
(let ((seconds (read-number "Time in seconds: ")))
(message "Sleeping ...")
(sleep-for seconds)
(message "Awake!"))

View file

@ -0,0 +1 @@
(string-to-number (read-string "Time in seconds: "))

View file

@ -0,0 +1,8 @@
#APPTYPE CONSOLE
DIM %msec
PRINT "Milliseconds to sleep: ";
%msec = FILEGETS(stdin, 10)
PRINT "Sleeping..."
SLEEP(%msec)
PRINT "Awake!"
PAUSE

View file

@ -0,0 +1,12 @@
make "Void "V0
make "Long "U4
make "kernel32_handle libload "kernel32.dll
to Sleep :dwMilliseconds
end
external "Sleep [ Void Sleep Long] :kernel32_handle
to millisleep :n
print [Sleeping...]
Sleep :n ; units: 1/1000th of a second
print [Awake.]
end

View file

@ -0,0 +1,10 @@
:- object(sleep).
:- public(how_long/1).
how_long(Seconds) :-
write('Sleeping ...'), nl,
thread_sleep(Seconds),
write('... awake!'), nl.
:- end_object.

View file

@ -0,0 +1,4 @@
| ?- sleep::how_long(5).
Sleeping ...
... awake!
yes

View file

@ -0,0 +1,14 @@
using System;
using System.Console;
using System.Threading.Thread; // this is where the Sleep() method comes from
module Zzzz
{
Main() : void
{
def nap_time = Int32.Parse(ReadLine());
WriteLine("Sleeping...");
Sleep(nap_time); // parameter is time in milliseconds
WriteLine("Awake!");
}
}