benchmarkclock

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package benchmarkclock measures benchmark intervals without changing runtime timers or the system timer resolution

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clock

type Clock struct {
	// contains filtered or unexported fields
}

Clock keeps raw monotonic counter ticks until an interval is measured

func New

func New() (*Clock, error)

Create the platform benchmark clock

func (*Clock) BetweenMS

func (c *Clock) BetweenMS(start, end int64) (float64, error)

Convert two ordered counter values to milliseconds

func (*Clock) ElapsedMS

func (c *Clock) ElapsedMS(start int64) (float64, error)

ElapsedMS requires a measurable total interval. A zero total cannot support a throughput measurement; report the failure instead of inventing a duration

func (*Clock) Now

func (c *Clock) Now() (int64, error)

Read the benchmark clock counter

func (*Clock) SinceMS

func (c *Clock) SinceMS(start int64) (float64, error)

SinceMS allows a zero sample when both readings fall on the same counter tick

Jump to

Keyboard shortcuts

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