RefreshRate
struct in
UnityEngine
Suggest a change
Success!
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Close
Submission failed
For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Close
Description
Represents the display refresh rate, or the number of frames the display can show per second.
using UnityEngine;
public class Example : MonoBehaviour
{
// Prints the refresh rate of every mode the monitor supports.
void Start()
{
foreach (Resolution resolution in Screen.resolutions)
{
RefreshRate rate = resolution.refreshRateRatio;
// A 59.94 Hz mode reports as 60000/1001.
Debug.Log(resolution.width + "x" + resolution.height + " at " +
rate.numerator + "/" + rate.denominator +
" (" + rate.value + " Hz)");
}
}
}
Properties
| Property |
Description |
| denominator | Denominator of the refresh rate fraction. |
| numerator | Numerator of the refresh rate fraction. |
| value | The numerical value of the refresh rate in hertz. |
Public Methods
| Method |
Description |
| Equals | Returns true if the refresh rates are equal. |
| GetHashCode | Returns the hash code for this refresh rate. |
Operators
| Operator |
Description |
| operator != | Returns true if two refresh rates are unequal. |
| operator == | Returns true if two refresh rates are equal. |