The plain C version:
#include <stdio.h>#include <time.h>#include <math.h> /* note // compile with -lm to link math lib: // gcc -o beats beats.c -lm */ #define SIZE 256 int main (void) { char buffer[SIZE]; time_t curtime; struct tm *gtime; /* Get the current UTC time. and adjust to UTC+1*/ curtime = time (NULL) + 3600; gtime = gmtime (&curtime); int beats = floor((gtime->tm_sec + (gtime->tm_min * 60) + (gtime->tm_hour * 3600)) / 86.4005529635 ); printf("Internet Time in beats @ %03d\n",beats); return 0; }
Post a Comment
No comments:
Post a Comment