in reply to Re: hex clock
in thread hex clock

I hope you mean that hours would range from 0-F, and minutes and seconds from 00-FF. That makes for about 12 hex seconds per real second, though.

Replies are listed 'Best First'.
Re^3: hex clock
by inman (Curate) on Apr 15, 2005 at 09:51 UTC
    I wasn't suggesting that 'Hex time' was a good idea per se it's just that representing the passage of time in a different measurement was more interesting than sprintf-ing the plain old hours minutes and seconds.

    What about 16-bit time as a concept? Subdividing a day into FFFF bits isn't too far off the number of conventional seconds in a day.

      I'd completely forgotten to do this. How about:
      #!/usr/bin/perl use strict; use Time::HiRes qw( usleep ); my $hex_sec_of_day=0; my $HEX_SEC = 0.7585069444444; my $HEX_MS_IN_SEC = $HEX_SEC*1000000; sub calc_curr_time_as_hex() { my ($s,$m,$h,@rest)=localtime(time()); # my $s=58;my $m=59;my$h=23; # test data $hex_sec_of_day = (($s+($m*60)+($h*3600))*$HEX_SEC); } calc_curr_time_as_hex(); $|=1; while(1) { printf ("\r0x%04x ", $hex_sec_of_day); $hex_sec_of_day++; # day flips from 0xFFFE to 0x0000, move thi +s line # below next line to have midnight as 0xFFF +F $hex_sec_of_day=0x0000 if($hex_sec_of_day>0xffff); usleep($HEX_MS_IN_SEC); }