cpu

package
v1.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2020 License: GPL-2.0, GPL-2.0-or-later Imports: 5 Imported by: 3

Documentation

Index

Constants

View Source
const (
	Second      float64 = 1
	Minute              = 60 * Second
	Hour                = 60 * Minute
	Day                 = 24 * Hour
	Microsecond         = 1e-6 * Second
	Millisecond         = 1e-3 * Second
)
View Source
const CacheLineBytes = 1 << Log2CacheLineBytes
View Source
const Log2CacheLineBytes = 6

Cache lines on x86 are 64 bytes.

Variables

This section is empty.

Functions

func GetCallerPC

func GetCallerPC(argp unsafe.Pointer) uintptr

func TimeInit

func TimeInit() float64

Types

type Time

type Time uint64

func TimeNow

func TimeNow() Time

func (*Time) Cycles

func (t *Time) Cycles(dt float64)

func (Time) Seconds

func (dt Time) Seconds() float64

type Timing

type Timing [2]Time

Aid for timing blocks of code.

func (*Timing) ClocksPer

func (t *Timing) ClocksPer(ops uint) float64

Number of cpu clock cycles per operation.

func (*Timing) PerSecond

func (t *Timing) PerSecond(ops uint) float64

Number of operations per second.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL