Documentation ¶
Overview ¶
Package cpufreq provides the current CPU frequency, in MHz, as reported by /proc/cpuinfo. Instead of returning a Go struct, it returns JSON serialized bytes. A function to deserialize the JSON serialized bytes into a cpufreq.Frequency struct is provided.
Note: the package name is cpufreq and not the final element of the import path (json).
Index ¶
- func Deserialize(p []byte) (*freq.Frequency, error)
- func Get() (p []byte, err error)
- func Marshal(f *freq.Frequency) ([]byte, error)
- func NewTicker(d time.Duration) (joe.Tocker, error)
- func Serialize(f *freq.Frequency) (p []byte, err error)
- func Unmarshal(p []byte) (*freq.Frequency, error)
- type Profiler
- type Ticker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Deserialize ¶
Deserialize takes some JSON serialized bytes and unmarshals them as cpufreq.Frequency.
func NewTicker ¶
NewTicker returns a new Ticker containing a Data channel that delivers the data at intervals and an error channel that delivers any errors encountered. Stop the ticker to signal the ticker to stop running. Stopping the ticker does not close the Data channel; call Close to close both the ticker and the data channel.