packages feed

cpuid-0.2.1.3: tests/TestCpuid.hs

-- This program is contained in the Cpuid documentation.
module Main(main) where

import Text.Printf (printf, )
import System.Cpuid

main :: IO ()
main = do
   (a, b, c, d) <- cpuid 0
   _ <- printf "basic CPUID usage: EAX=0: %8x %8x %8x %8x\n\n" a b c d
   _ <- printf "Vendor string: %s\n\n" =<< vendorString
   _ <- printf "Brand string: %s\n\n" =<< brandString
   putStrLn "Cache information:"
   putStrLn . unlines .
      map (\ v -> "  " ++ show v) =<< cacheInfo
   p <- processorInfo
   _ <- printf "processor info: family: %d, model: %d, stepping: %d, processor type: %d\n"
      (piFamily p) (piModel p) (piStepping p) (piType p)
   return ()