This example program displays a digital clock on the text console
$ include "seed7_05.s7i";
const proc: main is func
var time: next_time is time.value;
next_time := truncToSecond(time(NOW));
while not keypressed(KEYBOARD) do
next_time +:= 1 . SECONDS;
write(next_time <& " \r");
This example uses time functions like time(NOW), truncToSecond and await(next_time).
There is an addition of a duration to a time with +:= and a time is written with 'write(next_time)'.
The program is terminated when a key is pressed. This check is done with the keypressed(KEYBOARD) function.