Anonymous user
Nautical bell: Difference between revisions
→{{header|D}}: add stop method; more extensive output
(→{{header|REXX}}: clarified the REXX program description (in the section header). -- ~~~~) |
(→{{header|D}}: add stop method; more extensive output) |
||
Line 16:
class NauticalBell : Thread {
private bool stopped;
this () {
Line 34 ⟶ 35:
setNextBellTime();
while (
time = cast(TimeOfDay)Clock.currTime();
if (next.minute == time.minute &&
Line 45 ⟶ 46:
yield();
}
}
void stop() {
this.stopped = true;
}
}
Line 55 ⟶ 60:
{{out}}
<pre>
11:00:00 : 6 bells
11:30:00 : 7 bells
12:00:00 : 8 bells
12:30:00 : 1 bell</pre>
=={{header|REXX}}==
|