resolve time to msec

use gettimeofday(), and nanosleep() for "snooze"