File tree 2 files changed +3
-3
lines changed
packages/opentelemetry-core
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ export function timeInputToHrTime(time: api.TimeInput): api.HrTime {
85
85
return numberToHrtime ( time ) ;
86
86
}
87
87
} else if ( time instanceof Date ) {
88
- return [ time . getTime ( ) , 0 ] ;
88
+ return numberToHrtime ( time . getTime ( ) ) ;
89
89
} else {
90
90
throw TypeError ( 'Invalid input type' ) ;
91
91
}
Original file line number Diff line number Diff line change @@ -109,9 +109,9 @@ describe('time', () => {
109
109
110
110
describe ( '#timeInputToHrTime' , ( ) => {
111
111
it ( 'should convert Date hrTime' , ( ) => {
112
- const timeInput = new Date ( ) ;
112
+ const timeInput = new Date ( 1609297640313 ) ;
113
113
const output = timeInputToHrTime ( timeInput ) ;
114
- assert . deepStrictEqual ( output , [ timeInput . getTime ( ) , 0 ] ) ;
114
+ assert . deepStrictEqual ( output , [ 1609297640 , 312999964 ] ) ;
115
115
} ) ;
116
116
117
117
it ( 'should convert epoch milliseconds hrTime' , ( ) => {
You can’t perform that action at this time.
0 commit comments