From e6a706517187c280be652afa54ee75893bdf9608 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 30 Aug 2016 13:28:30 -0400 Subject: add coreCost --- Cost.hs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Cost.hs b/Cost.hs index 3e3e2df..8936dec 100644 --- a/Cost.hs +++ b/Cost.hs @@ -27,6 +27,11 @@ showCostMinutes (CPUCost (Seconds n)) | n < 61 = "1 minute" | otherwise = show (n `div` 60) ++ " minutes" +-- If an operation took n seconds on a number of cores, +-- multiple to get the CPUCost, which is for a single core. +coreCost :: Integer -> Seconds -> Cost op +coreCost cores (Seconds n) = CPUCost (Seconds (cores * n)) + castCost :: Cost a -> Cost b castCost (CPUCost s) = CPUCost s -- cgit v1.2.3