hlibcpuid-0.2.0: Bindings to https://github.com/anrieff/libcpuid

Copyright(c) Daniel Taskoff 2020
LicenseMIT
Maintainerdaniel.taskoff@gmail.com
Stabilityexperimental
Safe HaskellSafe
LanguageHaskell2010

System.LibCPUID.TSC

Contents

Description

Calculate the CPU clock, by using a time-stamp counter.

Usage:

do
  tscMark <- initialise
  mark tscMark
  foo
  unmark tscMark
  clock <- clockBy tscMark
Synopsis

TSCMark

mark :: TSCMark -> IO () Source #

Mark a time interval for calculating the CPU clock frequency.

unmark :: TSCMark -> IO () Source #

Unmark a time interval for calculating the CPU clock frequency.

clockBy :: TSCMark -> IO Int Source #

Calculate the CPU clock frequency in MHz, for an interval, marked with mark, and unmark. If the interval is insufficient, the result will be -1.