Represent time as double instead of struct timespec to simplify the