JDK-8140384: TicksToTimeHelper::milliseconds() should return a double
Bengt Rutisson
bengt.rutisson at oracle.com
Fri Oct 23 08:38:21 UTC 2015
Hi Markus,
On 2015-10-23 10:41, Markus Gronlund wrote:
> Hi Bengt,
>
> Looks good - thanks for fixing.
Thanks for looking at this!
>
> One small thing:
>
> I think we can drop the return (double) cast on line 55, no need for updated webrevs.
Good point. I'll fix that before I push.
Thanks,
Bengt
>
> Thanks
> Markus
>
> -----Original Message-----
> From: Bengt Rutisson
> Sent: den 23 oktober 2015 10:27
> To: serviceability-dev at openjdk.java.net serviceability-dev at openjdk.java.net
> Subject: JDK-8140384: TicksToTimeHelper::milliseconds() should return a double
>
>
> Hi all,
>
> Could I have a couple of reviews for this small change?
>
> http://cr.openjdk.java.net/~brutisso/8140384/webrev.00/
> https://bugs.openjdk.java.net/browse/JDK-8140384
>
> The TicksToTimeHelper class use different return values depending on if you want to convert to seconds or milliseconds.
>
> class TicksToTimeHelper : public AllStatic {
> public:
> enum Unit {
> SECONDS = 1,
> MILLISECONDS = 1000
> };
> static double seconds(const Tickspan& span);
> static jlong milliseconds(const Tickspan& span); };
>
> No one is using the conversion to milliseconds() but because it returns a jlong it loses precision.
>
> Making milliseconds() return a double allows for coming uses to get millisecond values with higher precision.
>
> Thanks,
> Bengt
More information about the serviceability-dev
mailing list