Added TimeStat function from collect-service as a function of StatHat

Added `StatHat.TimeStat` function; ported from the `collect-service`