diff --git a/src/QuickBench.hs b/src/QuickBench.hs index cf368b3..70d1ba1 100755 --- a/src/QuickBench.hs +++ b/src/QuickBench.hs @@ -11,7 +11,8 @@ import Data.List import Data.List.Split (splitOn) import Data.Maybe import Data.Time.Clock --- import Data.Time.Format () +import Data.Time.Format +import Data.Time.LocalTime import Safe import System.Console.Docopt import System.Directory @@ -132,14 +133,14 @@ defaultMain = when (null cmds) $ do out opts "No test commands found; provide some as arguments, with -f, or in ./bench.sh\n" exitSuccess - now <- getCurrentTime + now <- getCurrentZonedTime out opts $ printf "Running %d tests %d times%s at %s:\n" (length cmds) (iterations opts) (case executables opts of [] -> "" es -> printf " with %d executables" (length es)) - (show now) + (formatTime defaultTimeLocale "%Y-%m-%d %T %Z" now) let exes = case executables opts of [] -> [""] @@ -149,6 +150,12 @@ defaultMain = results <- mapM (runTestWithExes opts exes) cmds printSummary opts cmds exes cyc results +getCurrentZonedTime :: IO ZonedTime +getCurrentZonedTime = do + t <- getCurrentTime + tz <- getCurrentTimeZone + return $ utcToZonedTime tz t + runTestWithExes :: Opts -> [String] -> String -> IO [[Float]] runTestWithExes opts exes cmd = mapM (runTestWithExe opts cmd) exes