#include <iostream>
#include <ctime>
 
unsigned int GetActualTime()
{
    return (unsigned int)(((float)clock())/CLOCKS_PER_SEC*1000.f);
}
 
int main()
{
    float ThisDelta = 0.f;
    unsigned int LastTick = GetActualTime();
    float SomeObjectPosition = 0.f;
    float SomeObjectSpeed = 2.f; // Speed of the object, in Units per second.
    while(SomeObjectPosition <= 8.f)
    {
        unsigned int ThisTick = GetActualTime();
        if(ThisTick != LastTick)
        {
            ThisDelta = ((float)(ThisTick - LastTick))*0.001f;
            LastTick = ThisTick;
            
            // At this point, we have a delta time.
            // The delta time is the time, in MS, between the last frame and this frame.
    
            SomeObjectPosition += ThisDelta * SomeObjectSpeed;
            std::cout << SomeObjectPosition << std::endl;
        }
    }
    return 0;
}