@@ -546,7 +546,8 @@ CreateFrameNode(const napi_env &env, const v8::CpuProfileNode &node,
546
546
};
547
547
548
548
napi_value CreateSample (const napi_env &env, const enum ProfileFormat format,
549
- const uint32_t stack_id, const int64_t sample_timestamp,
549
+ const uint32_t stack_id,
550
+ const int64_t sample_timestamp_ns,
550
551
const double chunk_timestamp,
551
552
const uint32_t thread_id) {
552
553
napi_value js_node;
@@ -564,7 +565,7 @@ napi_value CreateSample(const napi_env &env, const enum ProfileFormat format,
564
565
switch (format) {
565
566
case ProfileFormat::kFormatThread : {
566
567
napi_value timestamp;
567
- napi_create_int64 (env, sample_timestamp , ×tamp);
568
+ napi_create_int64 (env, sample_timestamp_ns , ×tamp);
568
569
napi_set_named_property (env, js_node, " elapsed_since_start_ns" , timestamp);
569
570
} break ;
570
571
case ProfileFormat::kFormatChunk : {
@@ -643,7 +644,8 @@ static void GetSamples(const napi_env &env, const v8::CpuProfile *profile,
643
644
uint64_t sample_offset_from_profile_start_ms =
644
645
(sample_timestamp_us - profile_start_time_us) * 1e-3 ;
645
646
double seconds_since_start =
646
- profile_start_timestamp_ms + sample_offset_from_profile_start_ms;
647
+ (profile_start_timestamp_ms + sample_offset_from_profile_start_ms) *
648
+ 1e-3 ;
647
649
648
650
napi_value sample = nullptr ;
649
651
sample = CreateSample (env, format, stack_index, sample_timestamp_ns,
0 commit comments