adapted test_time.cpp