#include <iostream>
#include <time.h>  
using namespace std;      

class CTimer
{
    time_t _last;
    CTimer() { _last = time( NULL ); }
    CTimer(const CTimer &);
    CTimer& operator=(const CTimer&);
    ~CTimer()
	{}
public:
    static CTimer& getInstance(){        
        static CTimer instance;
        return instance;
    }

    float getDelta(){
        time_t now = time( NULL );
        float delta = (float)(now - _last);     
        return delta;
    }
    //should be called at the beginning of rendering function
    void update(){
        _last = time( NULL );
    }
};

int main()
{
cout<<"ok";
int vel = 4;
int posX = (vel * CTimer::getInstance().getDelta());
return 0;
}