time cast to avoid shift overflow