Subject: Re: [PATCH v3 7/8] trace2: add stopwatch timers

From: Junio C Hamano <[email-masked]>
Date: Thu, 20 Oct 2022 13:25:01 -0700

"Jeff Hostetler via GitGitGadget" <[email-masked]> writes:

> +#define NS_PER_SEC_D ((double)1000*1000*1000)
> ...
> +	double t_total = ((double)timer->total_ns) / NS_PER_SEC_D;
> +	double t_min = ((double)timer->min_ns) / NS_PER_SEC_D;
> +	double t_max = ((double)timer->max_ns) / NS_PER_SEC_D;

Hmph, it certainly is an improvement compared to the previous round,
but was there a reason why we did not want a more concise

	#define NS_TO_SECONDS(ns) ((double)(ns) / (1000*1000*1000.))

	double t_total = NS_TO_SECONDS(timer->total_ns);
	double t_min = NS_TO_SECONDS(timer->min_ns);
	double t_max = NS_TO_SECONDS(timer->max_ns);

that does not need to repeat (double) all over?

Not worth a reroll by itself.  Just wanted to know the reasoning
behind it, as I suspect I am missing the reason why it is good to
explicitly casting with (double) in some places; the above does not
look like one, though.

Thanks.