Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Be less precise about timings #24

Open
mitar opened this issue Feb 24, 2022 · 1 comment · May be fixed by #25
Open

Be less precise about timings #24

mitar opened this issue Feb 24, 2022 · 1 comment · May be fixed by #25

Comments

@mitar
Copy link

mitar commented Feb 24, 2022

Currently durations are rendered as:

strconv.FormatFloat(float64(m.Duration)/float64(time.Millisecond), 'f', -1, 64)

I think this is over precise: all digits beyond millisecond? That could even be a security issue as somebody could do timing attacks determining how long some operation is taking (e.g., password checking). I think there is really no point in sending more than 1 extra digit after milliseconds. I mean, how precise those measurements are anyway, no? They are not an average of multiple measurements.

So I suggest:

strconv.FormatFloat(float64(m.Duration)/float64(time.Millisecond), 'f', 1, 64)

I could be convinced to increase 1, but not to have it unbounded.

@mitar mitar linked a pull request Feb 24, 2022 that will close this issue
@mitar
Copy link
Author

mitar commented Feb 24, 2022

I made #25.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant