Skip to content

Instantly share code, notes, and snippets.

@Wowfunhappy
Created January 16, 2022 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Wowfunhappy/ea9cc5461c9712d34da57975b8c91294 to your computer and use it in GitHub Desktop.
Save Wowfunhappy/ea9cc5461c9712d34da57975b8c91294 to your computer and use it in GitHub Desktop.
Get Refresh Rate
CGDirectDisplayID displays;
uint32_t matchingDisplayCount = 1;
CGGetDisplaysWithRect([[NSApp mainWindow]frame], 1, &displays, &matchingDisplayCount);
double realRefreshRate = CGDisplayModeGetRefreshRate(CGDisplayCopyDisplayMode(displays));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment