unix only. compile with gcc -std=gnu99 filename.c -lrt