diff --git a/src/interpreter/heap.c b/src/interpreter/heap.c index 5408d9d1..d3ea672b 100644 --- a/src/interpreter/heap.c +++ b/src/interpreter/heap.c @@ -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);