time_circuit: update clock code to not use ctime()