Sorry for necroing this old thread. I did not want to create a new one on the same topic.
Turns out, I need this, too. I have a program that runs on 2D Monitors (one experimental condition) and also on VR HMDs. I want to perform a visual transition (change an object's color, e.g.) of a defined duration (1 s, e.g.). If I could find a method that tells me the current display's refresh rate, I could have this transition always taking 1 s irrespective of display device.
Initially, I was using this:
Code:
refresh_rate = int(viz.getOption('viz.monitor.refresh_rate'))
With the effect of the transition running faster on e.g. 90 Hz HMDs than on 60 Hz monitors, because 'monitor' does not return the refresh rate of the HMD.
I don't want to hard code, because "tomorrow" we might use another HMD or monitor with even another refresh rate. And I don't want to draw samples of elapsed frame time, because that might be unreliable.