Skip to content

Instantly share code, notes, and snippets.

@rubidium42
Created February 11, 2024 22:13
Show Gist options
  • Save rubidium42/968b839363e98e6d5a11843b59896c28 to your computer and use it in GitHub Desktop.
Save rubidium42/968b839363e98e6d5a11843b59896c28 to your computer and use it in GitHub Desktop.
diff --git a/src/openttd.cpp b/src/openttd.cpp
index 31db6b0d6..9320ed4b1 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -517,6 +517,16 @@ static const OptionData _options[] = {
*/
int openttd_main(int argc, char *argv[])
{
+ for (int i = 0; i < 32; i++) {
+ std::chrono::high_resolution_clock::time_point chrono_start = std::chrono::high_resolution_clock::now();
+ std::chrono::high_resolution_clock::time_point next;
+ do {
+ next = std::chrono::high_resolution_clock::now();
+ } while (chrono_start == next);
+
+ fmt::println("chrono resolution: {}", std::chrono::duration_cast<std::chrono::nanoseconds>(next - chrono_start).count());
+ }
+
std::string musicdriver;
std::string sounddriver;
std::string videodriver;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment