From 571448ca604065a6e6bfe7e6423b8ae6789b4dd9 Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Sun, 16 Dec 2018 01:02:08 +0100 Subject: Add helper compilation time to debug output --- lib/Distribution/Helper.hs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/Distribution/Helper.hs') diff --git a/lib/Distribution/Helper.hs b/lib/Distribution/Helper.hs index bafe3ca..7c3261f 100644 --- a/lib/Distribution/Helper.hs +++ b/lib/Distribution/Helper.hs @@ -110,6 +110,7 @@ import qualified Data.List.NonEmpty as NonEmpty import Data.Version import Data.Function import Data.Functor.Apply +import System.Clock as Clock import System.Environment import System.FilePath hiding ((<.>)) import System.Directory @@ -124,6 +125,7 @@ import qualified CabalHelper.Compiletime.Program.Stack as Stack import qualified CabalHelper.Compiletime.Program.GHC as GHC import qualified CabalHelper.Compiletime.Program.CabalInstall as CabalInstall import CabalHelper.Compiletime.Cabal +import CabalHelper.Compiletime.Log import CabalHelper.Compiletime.Sandbox import CabalHelper.Compiletime.Types import CabalHelper.Compiletime.Types.RelativePath @@ -576,7 +578,12 @@ getHelperExe proj_info QueryEnv{..} = do let comp = wrapper' qeProjLoc qeDistDir proj_info let ?progs = qePrograms ?cprogs = qeCompPrograms + t0 <- Clock.getTime Monotonic eexe <- compileHelper comp + t1 <- Clock.getTime Monotonic + let dt = (/10e9) $ fromInteger $ Clock.toNanoSecs $ Clock.diffTimeSpec t0 t1 + dt :: Float + vLog $ printf "compileHelper took %.5fs" dt case eexe of Left rv -> panicIO $ "compileHelper': compiling helper failed! exit code "++ show rv -- cgit v1.2.3