diff options
author | Jose A. Ortega Ruiz <jao@gnu.org> | 2010-01-18 02:07:02 +0100 |
---|---|---|
committer | Jose A. Ortega Ruiz <jao@gnu.org> | 2010-01-18 02:07:02 +0100 |
commit | c23b38c3c8841e948e521bec47264c1423678eff (patch) | |
tree | f6b8bdc1e842544e685648fc645745d20f0fa5ee | |
parent | d7c62ed01b25fb001dec0f9b472273be55b00363 (diff) | |
download | xmobar-c23b38c3c8841e948e521bec47264c1423678eff.tar.gz xmobar-c23b38c3c8841e948e521bec47264c1423678eff.tar.bz2 |
MultiCpus: average only over two samples
Ignore-this: bb8498323409ea15d452f46ab64f31cb
darcs-hash:20100118010702-40885-37a31605605a9cbf534fac9f4c04bf017c813bf2.gz
-rw-r--r-- | Plugins/Monitors/MultiCpu.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Plugins/Monitors/MultiCpu.hs b/Plugins/Monitors/MultiCpu.hs index c0fa21a..6bbcdd3 100644 --- a/Plugins/Monitors/MultiCpu.hs +++ b/Plugins/Monitors/MultiCpu.hs @@ -38,11 +38,12 @@ cpuParser = map parseList . cpuLists parseCpuData :: IO [[Float]] parseCpuData = - do (as, bs) <- doActionTwiceWithDelay 350000 cpuData + do (as, bs) <- doActionTwiceWithDelay 950000 cpuData let p0 = zipWith percent bs as - (as', bs') <- doActionTwiceWithDelay 350000 cpuData - let p1 = zipWith percent bs' as' - return $ zipWith (\x y -> zipWith (\a b -> (a + b) / 2.0) x y) p1 p0 + return p0 + -- (as', bs') <- doActionTwiceWithDelay 350000 cpuData + -- let p1 = zipWith percent bs' as' + -- return $ zipWith (\x y -> zipWith (\a b -> (a + b) / 2.0) x y) p1 p0 percent :: [Float] -> [Float] -> [Float] percent b a = if tot > 0 then map (/ tot) $ take 4 dif else [0, 0, 0, 0] |