Log initial PerformanceCouter frequency & epoch

This commit is contained in:
Edgaru089 2024-03-26 14:22:35 +08:00
parent 78644b87dc
commit c421b76f4c
2 changed files with 5 additions and 1 deletions

View File

@ -80,7 +80,7 @@ void player_Advance(System_Player *sys, Duration deltaTime) {
// Particles when dashing
if (time_Since(p->lastDash).microseconds < dashLength.microseconds && dabs(p->super->position->velocity.x) > EPS) {
static TimePoint lastDashEmit = {};
static Duration cooldown = {.microseconds = 10000};
static Duration cooldown = {.microseconds = 8000};
if (time_Since(lastDashEmit).microseconds > cooldown.microseconds) {
lastDashEmit = time_Now();
Vec2 to_pos = vec2_Add(p->super->position->position, vec2(0, -p->super->hitbox->box.size.y / 2.0));

View File

@ -146,6 +146,10 @@ TimePoint time_Now() {
LARGE_INTEGER freq;
QueryPerformanceFrequency(&freq);
freqInverse = 1000000.0 / ((double)freq.QuadPart);
LARGE_INTEGER time;
QueryPerformanceCounter(&time);
fprintf(stderr, "[time_Now] Frequency=%llu, Epoch=%llu\n", freq.QuadPart, time.QuadPart);
}
LARGE_INTEGER time;