psychopy.tools.gltools.getAbsTimeGPU

psychopy.tools.gltools.getAbsTimeGPU()[source]

Get the absolute GPU time in nanoseconds.

Returns:

Time elapsed in nanoseconds since the OpenGL context was fully realized.

Return type:

int

Examples

Get the current GPU time in seconds:

timeInSeconds = getAbsTimeGPU() * 1e-9

Get the GPU time elapsed:

t0 = getAbsTimeGPU()
# some drawing commands here ...
t1 = getAbsTimeGPU()
timeElapsed = (t1 - t0) * 1e-9  # take difference, convert to seconds

Back to top