Commit 21743f95 authored by Mikhail Glushenkov's avatar Mikhail Glushenkov
Browse files

Display the calculated mtime delay correctly.

parent c4390c84
......@@ -66,7 +66,8 @@ main = do
(tests mtimeChangeDelay)
-- Based on code written by Neill Mitchell for Shake. See
-- 'sleepFileTimeCalibrate' in 'Test.Type'.
-- 'sleepFileTimeCalibrate' in 'Test.Type'. The returned delay is never smaller
-- than 10 ms, but never larger than 1 second.
calibrateMtimeChangeDelay :: IO Int
calibrateMtimeChangeDelay = do
withTempDirectory silent "." "calibration-" $ \dir -> do
......@@ -81,8 +82,8 @@ calibrateMtimeChangeDelay = do
spin (0::Int)
let mtimeChange = maximum mtimes
putStrLn $ "Mtime delay calibration completed, calculated delay: "
++ (show mtimeChange) ++ " ms."
return $ min 1000000 mtimeChange
++ (show $ fromIntegral mtimeChange / (1000.0 :: Double)) ++ " ms."
return $ min 1000000 (max 10000 mtimeChange)
where
time :: IO () -> IO Int
time act = do
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment