I don't think we can change the `time` form from `racket/base` without
breaking existing uses. For better or worse, various scripts parse the
output, especially since the output format has been stable.
But there's nothing special about the pre-defined `time` form. A new
form could use `time-apply` plus `current-memory-use` --- or even
functions like `current-inexact-monotonic-milliseconds` and
`current-gc-milliseconds instead of `time-apply` --- to get information
to display.
At Mon, 12 Jul 2021 06:37:38 -0700 (PDT), leonardo lv wrote:
> Hi All,
>
> Whether the (time) procedure can be similar to Chez Scheme, when printing
> the time consumed by expressions, it also prints out how many bytes are
> allocated, which is very beneficial for debugging and optimization.
>
> * 19 collections 0.201254290s elapsed cpu time, including 0.183228711s
> collecting 0.201678000s elapsed real time, including 0.183665000s
> collecting 160012160 bytes allocated, including 113015168 bytes
> reclaimed*