diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-08-30 13:28:30 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-08-30 13:29:47 -0400 |
commit | e6a706517187c280be652afa54ee75893bdf9608 (patch) | |
tree | f7b073ede11ad51bd83972e8ce9c29712d2799a0 | |
parent | 2106de31f7a8e37bb2ea8b8e9650a26dbef0d893 (diff) | |
download | keysafe-e6a706517187c280be652afa54ee75893bdf9608.tar.gz |
add coreCost
-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 |