Show / Hide Table of Contents

Class Utils

A collection of utility functions exposed by OpenTK.

Inheritance
object
Utils
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: OpenTK.Core
Assembly: OpenTK.Core.dll
Syntax
public static class Utils

Methods

AccurateSleep(double, int)

A method for accurate sleep times. This function will favour accuracy over efficiency and spin wait if it's unsure a sleep will wake in time.

This is useful when implementing a run-loop with accurate timings.

Declaration
public static void AccurateSleep(double seconds, int expectedSchedulerPeriod)
Parameters
Type Name Description
double seconds

The number of seconds to sleep for.

int expectedSchedulerPeriod

The expected scheduler period in milliseconds. Can also be seen as the expected sleep time of Thread.Sleep(1).
Set on windows using timeBeginPeriod().

Remarks

The details of this method is described in detail here: https://blog.bearcats.nl/perfect-sleep-function/.

FromTszString(char*, int)

Declaration
public static string FromTszString(char* ptr, int max_length)
Parameters
Type Name Description
char* ptr
int max_length
Returns
Type Description
string
In this article
Back to top Generated by DocFX