title: C++ - using glfwGetTime() for a fixed time step
body: <p>After doing some research and debugging in my C++ project with glfwGetTime(), I'm having trouble making a game loop for my project. As far as time goes I really only worked with nanoseconds in Java and on the GLFW website it states that the function returns the time in <strong><em>seconds</em></strong>. How would I make a fixed time step loop with glfwGetTime()?</p>
  
  <p>What I have now - </p>
  
  <pre><code>while(!glfwWindowShouldClose(window))
      {
              double now = glfwGetTime();
              double delta = now - lastTime;
              lastTime = now;
  
              accumulator += delta;
  
              while(accumulator &gt;= OPTIMAL_TIME) // OPTIMAL_TIME = 1 / 60
              {
                       //tick
  
                      accumulator -= OPTIMAL_TIME;
              }
  </code></pre>
  
  <p>}</p>