|
|
|
@ -11,7 +11,7 @@ Simulation::Simulation() { |
|
|
|
|
QTimer::connect(timer, &QTimer::timeout, this, &Simulation::update); |
|
|
|
|
timer->setInterval(updateInterval); |
|
|
|
|
timer->start(); |
|
|
|
|
lastUpdate = high_resolution_clock::now(); |
|
|
|
|
lastUpdate = system_clock::now(); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
void Simulation::draw(QPainter *p, int screenSize) { |
|
|
|
@ -22,7 +22,7 @@ void Simulation::draw(QPainter *p, int screenSize) { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Simulation::update() { |
|
|
|
|
auto thisUpdate = high_resolution_clock::now(); |
|
|
|
|
auto thisUpdate = system_clock::now(); |
|
|
|
|
auto ms = (int)duration_cast<milliseconds>(thisUpdate - lastUpdate).count(); |
|
|
|
|
lastUpdate = thisUpdate; |
|
|
|
|
|
|
|
|
|