actual time delta

This commit is contained in:
2023-01-18 18:31:00 +01:00
parent 365edc35e9
commit 9f8f681e18
3 changed files with 8 additions and 4 deletions

View File

@@ -197,8 +197,9 @@ ToxClient::~ToxClient(void) {
}
bool ToxClient::iterate(void) {
// HACK: hardcoded 5ms sleep in main
float time_delta {0.005f};
auto new_time = std::chrono::high_resolution_clock::now();
const float time_delta {std::chrono::duration<float>(new_time - _last_time).count()};
_last_time = new_time;
tox_iterate(_tox, this);
NGC_FT1_iterate(_tox, _ft1_ctx, time_delta);