Swatch time in C..

Here’s a simple little C subroutine to return the current time in “swatch internet ” format. As if there aren’t enough time formats to worry about…

long swatch_time() { long beat; time_t cur_time; cur_time = time(&cur_time); beat = (((((long)cur_time)-(((long)cur_time) – ((((long)cur_time) %86400) + 3600))) * 10) / 864); while (beat < 0) { beat += 1000; } return (beat = beat % 1000); }