Skip to content

Commit cd8362a

Browse files
committed
Show how long installtion took.
1 parent 902d183 commit cd8362a

2 files changed

Lines changed: 1292 additions & 1283 deletions

File tree

Tools/Install.hs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ import System.Directory
1111
import System.Environment
1212
import System.FilePath
1313
import System.Process
14+
import System.IO.TimeMilli
1415
import MicroHs.Config
1516

1617
type CConf = [(Key, Value)]
1718

1819

1920
main :: IO ()
2021
main = do
22+
start <- getTimeMilli
2123
args <- getArgs
2224
let flags = decodeArgs defaultFlags args
2325
confText <- macroExpand flags <$> readFile (confFile flags)
@@ -33,6 +35,11 @@ main = do
3335

3436
install flags'
3537

38+
end <- getTimeMilli
39+
let delta = (end - start) `quot` 100
40+
(sec, tenths) = delta `quotRem` 10
41+
putStrLn $ "Install time: " ++ show sec ++ "." ++ show tenths ++ "s"
42+
3643
install :: Flags -> IO ()
3744
install flags = do
3845
instBin flags

0 commit comments

Comments
 (0)