diff options
Diffstat (limited to 'Cost.hs')
-rw-r--r-- | Cost.hs | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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 |