Sleep: Difference between revisions

Content added Content deleted
mNo edit summary
(Rename Perl 6 -> Raku, alphabetize, minor clean-up)
Line 228: Line 228:
AWAKE
AWAKE
</pre>
</pre>

=={{header|ARM Assembly}}==
=={{header|ARM Assembly}}==
{{works with|as|Raspberry Pi}}
{{works with|as|Raspberry Pi}}
Line 825: Line 826:
Awake!
Awake!
</pre>
</pre>

=={{header|Elena}}==
=={{header|Elena}}==
ELENA 4.x :
ELENA 4.x :
Line 1,475: Line 1,477:
<pre>14:23:40
<pre>14:23:40
14:23:50</pre>
14:23:50</pre>

=={{header|Oz}}==
=={{header|Oz}}==
<lang oz>declare
<lang oz>declare
Line 1,558: Line 1,560:
select undef, undef, undef, 0.5;
select undef, undef, undef, 0.5;
say "Awake!";</lang>
say "Awake!";</lang>

=={{header|Perl 6}}==

The <tt>sleep</tt> function argument is in units of seconds, but these may be fractional (to the limits of your system's clock).

<lang perl6>my $sec = prompt("Sleep for how many microfortnights? ") * 1.2096;
say "Sleeping...";
sleep $sec;
say "Awake!";</lang>

Note that 1.2096 is a rational number in Perl&nbsp;6, not floating point, so precision can be maintained even when dealing with very small powers of ten.


=={{header|Phix}}==
=={{header|Phix}}==
Line 1,676: Line 1,667:
(displayln "Awake!"))
(displayln "Awake!"))
</lang>
</lang>

=={{header|Raku}}==
(formerly Perl 6)

The <tt>sleep</tt> function argument is in units of seconds, but these may be fractional (to the limits of your system's clock).

<lang perl6>my $sec = prompt("Sleep for how many microfortnights? ") * 1.2096;
say "Sleeping...";
sleep $sec;
say "Awake!";</lang>

Note that 1.2096 is a rational number in Perl&nbsp;6, not floating point, so precision can be maintained even when dealing with very small powers of ten.


=={{header|RapidQ}}==
=={{header|RapidQ}}==
Line 2,088: Line 2,091:


<!--Out of alphabetical order to keep the VB languages together-->
<!--Out of alphabetical order to keep the VB languages together-->

=={{header|Vedit macro language}}==
<lang vedit>#1 = Get_Num("Sleep time in 1/10 seconds: ")
Message("Sleeping...\n")
Sleep(#1)
Message("Awake!\n")</lang>

=={{header|Visual Basic .NET}}==
=={{header|Visual Basic .NET}}==


Line 2,098: Line 2,108:
End Sub
End Sub
End Module</lang>
End Module</lang>

=={{header|Vedit macro language}}==
<lang vedit>#1 = Get_Num("Sleep time in 1/10 seconds: ")
Message("Sleeping...\n")
Sleep(#1)
Message("Awake!\n")</lang>


=={{header|X86 Assembly}}==
=={{header|X86 Assembly}}==