-
Notifications
You must be signed in to change notification settings - Fork 0
/
time.go
25 lines (22 loc) · 893 Bytes
/
time.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package glfw
//#include "glfw/include/GLFW/glfw3.h"
import "C"
// GetTime returns the value of the GLFW timer. Unless the timer has been set
// using SetTime, the timer measures time elapsed since GLFW was initialized.
//
// The resolution of the timer is system dependent, but is usually on the order
// of a few micro- or nanoseconds. It uses the highest-resolution monotonic time
// source on each supported platform.
func GetTime() (float64, error) {
return float64(C.glfwGetTime()), fetchError()
}
// SetTime sets the value of the GLFW timer. It then continues to count up from
// that value.
//
// The resolution of the timer is system dependent, but is usually on the order
// of a few micro- or nanoseconds. It uses the highest-resolution monotonic time
// source on each supported platform.
func SetTime(time float64) error {
C.glfwSetTime(C.double(time))
return fetchError()
}