kurokida / jspsych-psychophysics

A jsPsych plugin for psychophysics
https://kurokida.github.io/jspsych-psychophysics/
MIT License
51 stars 13 forks source link

Meaning of avg_frame_rate #13

Closed lawero closed 3 years ago

lawero commented 3 years ago

The frame rate for a 60Hz monitor is about 16.6s. What does mean when the avg_frame_rate is about (for example) 20ms?

kurokida commented 3 years ago

Thank you for using my plugin! I apologize for the delay in responding.

The avg_frame_time is calculated as follows.

elapsed_time = the time when the requestAnimationFrame was last called - the time when the requestAnimationFrame was first called

avg_frame_time = elapsed_time / the number of times the requestAnimationFrame was called.

For example, if the elapsed time is longer for some reason, the avg_frame_time will also be longer than the theoretical value

Is this answer sufficient?

lawero commented 3 years ago

yes, thanks! :D