nice and more consistent implementation for the time parameter, also I add stdexcept include in const to compile with g++