Skip to content

Commit

Permalink
fix(core): stop rounding to nearest int in hrTimeTo*seconds() functions
Browse files Browse the repository at this point in the history
  • Loading branch information
aabmass committed Jul 21, 2023
1 parent 87f21ef commit b6360a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/opentelemetry-core/src/common/time.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@ export function hrTimeToNanoseconds(time: api.HrTime): number {
* @param time
*/
export function hrTimeToMilliseconds(time: api.HrTime): number {
return Math.round(time[0] * 1e3 + time[1] / 1e6);
return time[0] * 1e3 + time[1] / 1e6;
}

/**
* Convert hrTime to microseconds.
* @param time
*/
export function hrTimeToMicroseconds(time: api.HrTime): number {
return Math.round(time[0] * 1e6 + time[1] / 1e3);
return time[0] * 1e6 + time[1] / 1e3;
}

/**
Expand Down

0 comments on commit b6360a5

Please sign in to comment.