Class Utils
A collection of utility functions exposed by OpenTK.
Inherited Members
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 |
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 |