@@ -65,15 +65,15 @@ stepTime = do
65 h1 <- fmap hundredsOfNanosSinceGregorianReform getCurrentTime
65 h1 <- fmap hundredsOfNanosSinceGregorianReform getCurrentTime
66 if h1 > h0
66 if h1 > h0
68− writeIORef state $ State 0 h1
68+ writeIORef state $ State c0 h1
69 return $ Just (c0, h1)
69 return $ Just (c0, h1)
72 c1 = succ c0
72 c1 = succ c0
73 if c1 < 2^14
73 if c1 < 2^14
75− writeIORef state $ State c1 h0
75+ writeIORef state $ State c1 h1
76− return $ Just (c1, h0)
76+ return $ Just (c1, h1)
78 return Nothing
78 return Nothing
@@ -81,7 +81,7 @@ stepTime = do
81{-# NOINLINE state #-}
81{-# NOINLINE state #-}
82state = unsafePerformIO $ do
82state = unsafePerformIO $ do
83 h0 <- fmap hundredsOfNanosSinceGregorianReform getCurrentTime
83 h0 <- fmap hundredsOfNanosSinceGregorianReform getCurrentTime
84− newIORef $ State 0 h0
84+ newIORef $ State 0 h0 -- the 0 should be a random number
87data State = State
87data State = State