summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNorbert Zeh <nzeh@cs.dal.ca>2011-02-21 19:58:26 -0400
committerNorbert Zeh <nzeh@cs.dal.ca>2011-02-21 19:58:26 -0400
commit2a005217151dbfff86c3d4a478ee8d305d04eb4c (patch)
tree0c2ee79932ff84c42eedc8655047e2a28c12bd6a
parent34dcc41287af8070ffab2e049016ad7dae39e255 (diff)
downloadxmobar-2a005217151dbfff86c3d4a478ee8d305d04eb4c.tar.gz
xmobar-2a005217151dbfff86c3d4a478ee8d305d04eb4c.tar.bz2
Fixed math in Command.tenthSeconds
-rw-r--r--src/Commands.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Commands.hs b/src/Commands.hs
index 38d0aed..1bfbb94 100644
--- a/src/Commands.hs
+++ b/src/Commands.hs
@@ -75,8 +75,7 @@ instance Exec Command where
-- is not possible to set a thread delay grater than about 45 minutes.
-- With a little recursion we solve the problem.
tenthSeconds :: Int -> IO ()
-tenthSeconds s | s >= x = do threadDelay y
- tenthSeconds (x - s)
+tenthSeconds s | s >= x = do threadDelay (x * 100000)
+ tenthSeconds (s - x)
| otherwise = threadDelay (s * 100000)
- where y = maxBound :: Int
- x = y `div` 100000
+ where x = (maxBound :: Int) `div` 100000