Update heap.c

This commit is contained in:
blueloveTH 2025-11-26 23:30:22 +08:00
parent d03610071a
commit 272388ed8f

View File

@ -40,12 +40,12 @@ static void ManagedHeap__fire_debug_callback(ManagedHeap* self, ManagedHeapSwpet
c11_sbuf buf;
c11_sbuf__ctor(&buf);
const int64_t NANOS_PER_SEC = 1000000000;
const int64_t NANOS_PER_MS = 1000000000 / 1000;
const char* DIVIDER = "------------------------------------------------------------\n";
double start = out_info->start_ns / 1e9;
int64_t mark_ms = (out_info->mark_end_ns - out_info->start_ns) / NANOS_PER_SEC;
int64_t swpet_ms = (out_info->swpet_end_ns - out_info->mark_end_ns) / NANOS_PER_SEC;
int64_t mark_ms = (out_info->mark_end_ns - out_info->start_ns) / NANOS_PER_MS;
int64_t swpet_ms = (out_info->swpet_end_ns - out_info->mark_end_ns) / NANOS_PER_MS;
c11_sbuf__write_cstr(&buf, DIVIDER);
pk_sprintf(&buf, "start: %f\n", (double)start / 1000);