Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
21743f95
Commit
21743f95
authored
Feb 16, 2016
by
Mikhail Glushenkov
Browse files
Display the calculated mtime delay correctly.
parent
c4390c84
Changes
1
Hide whitespace changes
Inline
Side-by-side
cabal-install/tests/UnitTests.hs
View file @
21743f95
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment