Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
11
Task/Sleep/Ada/sleep.adb
Normal file
11
Task/Sleep/Ada/sleep.adb
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
with Ada.Text_Io; use Ada.Text_Io;
|
||||
with Ada.Float_Text_Io; use Ada.Float_Text_Io;
|
||||
|
||||
procedure Sleep is
|
||||
In_Val : Float;
|
||||
begin
|
||||
Get(In_Val);
|
||||
Put_Line("Sleeping...");
|
||||
delay Duration(In_Val);
|
||||
Put_Line("Awake!");
|
||||
end Sleep;
|
||||
6
Task/Sleep/AutoIt/sleep.au3
Normal file
6
Task/Sleep/AutoIt/sleep.au3
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#AutoIt Version: 3.2.10.0
|
||||
$sleep_me=InputBox("Sleep", "Number of seconds to sleep", "10", "", -1, -1, 0, 0)
|
||||
Dim $sleep_millisec=$sleep_me*1000
|
||||
MsgBox(0,"Sleep","Sleeping for "&$sleep_me&" sec")
|
||||
sleep ($sleep_millisec)
|
||||
MsgBox(0,"Awake","... Awaking")
|
||||
15
Task/Sleep/COBOL/sleep-1.cob
Normal file
15
Task/Sleep/COBOL/sleep-1.cob
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
IDENTIFICATION DIVISION.
|
||||
PROGRAM-ID. Sleep-In-Seconds.
|
||||
|
||||
DATA DIVISION.
|
||||
WORKING-STORAGE SECTION.
|
||||
01 Seconds-To-Sleep USAGE IS FLOAT-LONG.
|
||||
|
||||
PROCEDURE DIVISION.
|
||||
ACCEPT Seconds-To-Sleep
|
||||
DISPLAY "Sleeping..."
|
||||
CONTINUE AFTER Seconds-To-Sleep SECONDS
|
||||
DISPLAY "Awake!"
|
||||
GOBACK.
|
||||
|
||||
END PROGRAM Sleep-In-Seconds.
|
||||
18
Task/Sleep/COBOL/sleep-2.cob
Normal file
18
Task/Sleep/COBOL/sleep-2.cob
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
IDENTIFICATION DIVISION.
|
||||
PROGRAM-ID. Sleep-In-Seconds.
|
||||
|
||||
DATA DIVISION.
|
||||
WORKING-STORAGE SECTION.
|
||||
01 Seconds-To-Sleep USAGE IS COMP-2.
|
||||
*> Note: COMP-2, while supported on most implementations, is
|
||||
*> non-standard. FLOAT-SHORT is the proper USAGE for Native
|
||||
*> IEEE 754 Binary64 Floating-point data items.
|
||||
|
||||
PROCEDURE DIVISION.
|
||||
ACCEPT Seconds-To-Sleep
|
||||
DISPLAY "Sleeping..."
|
||||
CALL "C$SLEEP" USING BY CONTENT Seconds-To-Sleep
|
||||
DISPLAY "Awake!"
|
||||
GOBACK.
|
||||
|
||||
END PROGRAM Sleep-In-Seconds.
|
||||
26
Task/Sleep/COBOL/sleep-3.cob
Normal file
26
Task/Sleep/COBOL/sleep-3.cob
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
IDENTIFICATION DIVISION.
|
||||
PROGRAM-ID. Sleep-In-Nanoseconds.
|
||||
OPTIONS.
|
||||
DEFAULT ROUNDED MODE IS NEAREST-AWAY-FROM-ZERO.
|
||||
|
||||
DATA DIVISION.
|
||||
WORKING-STORAGE SECTION.
|
||||
01 Seconds-To-Sleep USAGE IS FLOAT-LONG.
|
||||
01 Nanoseconds-To-Sleep USAGE IS FLOAT-LONG.
|
||||
01 Nanoseconds-Per-Second CONSTANT AS 1000000000.
|
||||
|
||||
PROCEDURE DIVISION.
|
||||
ACCEPT Seconds-To-Sleep
|
||||
COMPUTE Nanoseconds-To-Sleep
|
||||
= Seconds-To-Sleep * Nanoseconds-Per-Second
|
||||
END-COMPUTE
|
||||
|
||||
DISPLAY "Sleeping..."
|
||||
CALL "CBL_OC_NANOSLEEP"
|
||||
USING BY CONTENT Nanoseconds-To-Sleep
|
||||
END-CALL
|
||||
|
||||
DISPLAY "Awake!"
|
||||
GOBACK.
|
||||
|
||||
END PROGRAM Sleep-In-Nanoseconds.
|
||||
5
Task/Sleep/Crystal/sleep.cr
Normal file
5
Task/Sleep/Crystal/sleep.cr
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
print "Seconds to sleep: "
|
||||
duration = gets.not_nil!.to_f.seconds
|
||||
puts "Sleeping..."
|
||||
sleep duration
|
||||
puts "Awake!"
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
^|The pause command takes milliseconds, we adjust to seconds|^
|
||||
fun main = int by List args
|
||||
fun main ← int by List args
|
||||
int seconds
|
||||
if args.length == 1 do seconds = int!args[0] end
|
||||
if seconds == 0
|
||||
seconds = ask(int, "Enter number of seconds to sleep: ")
|
||||
if args.length æ 1 do seconds ← int!args[0] end
|
||||
if seconds æ 0
|
||||
seconds ← ask(int, "Enter number of seconds to sleep: ")
|
||||
end
|
||||
writeLine("Sleeping...")
|
||||
pause(1000 * seconds)
|
||||
|
|
|
|||
4
Task/Sleep/Emacs-Lisp/sleep.el
Normal file
4
Task/Sleep/Emacs-Lisp/sleep.el
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
(let ((seconds (read-number "Time in seconds: ")))
|
||||
(message "Sleeping ...")
|
||||
(sleep-for seconds)
|
||||
(message "Awake!"))
|
||||
4
Task/Sleep/PowerShell/sleep.ps1
Normal file
4
Task/Sleep/PowerShell/sleep.ps1
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
$d = [int] (Read-Host Duration in seconds)
|
||||
Write-Host Sleeping ...
|
||||
Start-Sleep $d
|
||||
Write-Host Awake!
|
||||
9
Task/Sleep/Rebol/sleep.rebol
Normal file
9
Task/Sleep/Rebol/sleep.rebol
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
Rebol [
|
||||
Title: "Sleep Main Thread"
|
||||
URL: http://rosettacode.org/wiki/Sleep_the_Main_Thread
|
||||
]
|
||||
|
||||
naptime: to-integer ask "Please enter sleep time in seconds: "
|
||||
print "Sleeping..."
|
||||
wait naptime
|
||||
print "Awake!"
|
||||
4
Task/Sleep/Rye/sleep.rye
Normal file
4
Task/Sleep/Rye/sleep.rye
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
time: 3000 ;milliseconds
|
||||
print "Asleep"
|
||||
sleep time
|
||||
print "Awake now!"
|
||||
4
Task/Sleep/VBScript/sleep.vbs
Normal file
4
Task/Sleep/VBScript/sleep.vbs
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
iSeconds=InputBox("Enter a time in seconds to sleep: ","Sleep Example for RosettaCode.org")
|
||||
WScript.Echo "Sleeping..."
|
||||
WScript.Sleep iSeconds*1000 'Sleep is done in Milli-Seconds
|
||||
WScript.Echo "Awake!"
|
||||
Loading…
Add table
Add a link
Reference in a new issue