diff --git a/main.cpp b/main.cpp index 5e30c77..9985195 100644 --- a/main.cpp +++ b/main.cpp @@ -5,6 +5,9 @@ #include #include "vulkan/vulkan.h" +#include +#include + VkInstance instance; VkDevice device; @@ -172,7 +175,16 @@ void startVulkan() { void gameLoop() { while (!glfwWindowShouldClose(window)) { + auto start = std::chrono::steady_clock::now(); + + std::chrono::system_clock::now().time_since_epoch(); glfwPollEvents(); + auto end = std::chrono::steady_clock::now(); + + std::cout << "Frequency : " + << 1000000 / (int)(std::chrono::duration_cast(end - start).count()) + << " fps" << std::endl; + std::this_thread::sleep_for(std::chrono::milliseconds(20)); } }