animclock

package
v0.2.27 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: MIT Imports: 2 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 animclock is the instant animations read: the local clock, or the one a test pins with SetClock, and the conversion of a frame callback's timestamp onto it. The clocks that schedule animations live in package anim.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Now

func Now() time.Time

Now is the animations' current instant: the pinned one under SetClock.

func SetClock

func SetClock(fn func() time.Time) (restore func())

SetClock replaces the time source launches and deadlines read and returns the restore function; nil restores time.Now.

Types

type FrameClock added in v0.2.5

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

FrameClock converts a frame callback's timestamp, milliseconds from an undefined base that wraps, to an instant on the local clock.

func (*FrameClock) Instant added in v0.2.5

func (c *FrameClock) Instant(ms uint32, now time.Time) time.Time

Instant is when the compositor's ms happened on the local clock, never after now. It keeps the earliest local reading of the compositor's clock as its anchor, so a delivery's latency is what it subtracts, and starts again from now when ms sits further behind than any delivery plausibly does.

Jump to

Keyboard shortcuts

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