3 add explanation
source | link

Perl 6, 104 bytes

DateTime.now.&{"\ec{.hour.fmt: '%2s'} {'-'x.minute}\n{(.hour+1).fmt: '%2s'} {'-'x 60-.minute}"}.say xx*

Needs to be run on a ANSI compatible terminal so that the <ESC>c control sequence for resetting the terminal works.

Pretty basic (because the more obfuscated approaches I tried turned out longer):

  • DateTime.now.&{" "}.say xx*: Transform the current time into a string (see below) and say it, and repeat all of that an infinite number of times. The string is built like this:
    • \ec: ANSI control code <ESC>c for resetting the terminal, which clears the screen.
    • {.hour.fmt: '%2s'}: hour, right-aligned to 2 columns
    • : space
    • {'-'x.minute}: dash repeated times the minute
    • \n: newline
    • {(.hour+1).fmt: '%2s'}: next hour, right-aligned to 2 columns
    • : space
    • {'-'x 60-.minute}: dash repeated times 60 minus the minute

Perl 6, 104 bytes

DateTime.now.&{"\ec{.hour.fmt: '%2s'} {'-'x.minute}\n{(.hour+1).fmt: '%2s'} {'-'x 60-.minute}"}.say xx*

Needs to be run on a ANSI compatible terminal so that the <ESC>c control sequence for resetting the terminal works.

Perl 6, 104 bytes

DateTime.now.&{"\ec{.hour.fmt: '%2s'} {'-'x.minute}\n{(.hour+1).fmt: '%2s'} {'-'x 60-.minute}"}.say xx*

Needs to be run on a ANSI compatible terminal so that the control sequence for resetting the terminal works.

Pretty basic (because the more obfuscated approaches I tried turned out longer):

  • DateTime.now.&{" "}.say xx*: Transform the current time into a string (see below) and say it, and repeat all of that an infinite number of times. The string is built like this:
    • \ec: ANSI control code <ESC>c for resetting the terminal, which clears the screen.
    • {.hour.fmt: '%2s'}: hour, right-aligned to 2 columns
    • : space
    • {'-'x.minute}: dash repeated times the minute
    • \n: newline
    • {(.hour+1).fmt: '%2s'}: next hour, right-aligned to 2 columns
    • : space
    • {'-'x 60-.minute}: dash repeated times 60 minus the minute
2 update for relaxed task description (-10 bytes)
source | link

Perl 6, 114104 bytes

(sleep 60*say DateTime.now.&{"\ec{.hour.fmt: '%2s'} {'-'x.minute}\n{(.hour+1).fmt: '%2s'} {'-'x 60-.minute}"}).say xx*

Needs to be run on a ANSI compatible terminal so that the <ESC>c control sequence for resetting the terminal works.

Perl 6, 114 bytes

(sleep 60*say DateTime.now.&{"\ec{.hour.fmt: '%2s'} {'-'x.minute}\n{(.hour+1).fmt: '%2s'} {'-'x 60-.minute}"})xx*

Needs to be run on a ANSI compatible terminal so that the <ESC>c control sequence for resetting the terminal works.

Perl 6, 104 bytes

DateTime.now.&{"\ec{.hour.fmt: '%2s'} {'-'x.minute}\n{(.hour+1).fmt: '%2s'} {'-'x 60-.minute}"}.say xx*

Needs to be run on a ANSI compatible terminal so that the <ESC>c control sequence for resetting the terminal works.

1
source | link

Perl 6, 114 bytes

(sleep 60*say DateTime.now.&{"\ec{.hour.fmt: '%2s'} {'-'x.minute}\n{(.hour+1).fmt: '%2s'} {'-'x 60-.minute}"})xx*

Needs to be run on a ANSI compatible terminal so that the <ESC>c control sequence for resetting the terminal works.