util

package
Version: v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2021 License: BSD-2-Clause Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FrameRater

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

FrameRater implements a frame rate controller

func NewFrameRater

func NewFrameRater(targetFPS uint) *FrameRater

NewFrameRater returns a frame rate controller object for the specified number of target frames per second

func (*FrameRater) FPS

func (f *FrameRater) FPS(t time.Duration) (float64, float64, bool)

FPS calculates and returns the current measured FPS and the maximum potential FPS after the specified time interval has elapsed. It returns an indication if the results are valid

func (*FrameRater) Start

func (f *FrameRater) Start()

Start should be called at the start of the frame

func (*FrameRater) Wait

func (f *FrameRater) Wait()

Wait should be called at the end of the frame If necessary it will sleep to achieve the desired frame rate

Source Files

Directories

Path Synopsis
Package logger implements an hierarchical logger used by other packages.
Package logger implements an hierarchical logger used by other packages.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL