Skip to content

Instantly share code, notes, and snippets.

@henrik
Last active December 19, 2015 20:37
Show Gist options
  • Save henrik/856b02213fddb7829fdd to your computer and use it in GitHub Desktop.
Save henrik/856b02213fddb7829fdd to your computer and use it in GitHub Desktop.
# NOTE: This is UTC
# NOTE: if run after the new year, might have weird behaviour
# ?Ϩ is 1000. Figured it out like so: to_string([1000])
# Changed `:os.system_time(:seconds)` to `:erlang.system_time(1)` after seeing @padde's solution
# Changed divmod function to inline div and rem at @padde's suggestion
# char count: 176
for x<-1451606400-:erlang.system_time(1)..0do
m=div x,60
s=rem x,60
h=div m,60
m=rem m,60
:io.fwrite"~3..0B:~2..0B:~2..0B:~2..0B\r",[div(h,24),rem(h,24),m,s]
:timer.sleep ?Ϩend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment