@@ -575,9 +575,7 @@ std::unique_ptr<ScenarioResult> RunScenario(
575
575
// Start a run
576
576
gpr_log (GPR_INFO, " Starting" );
577
577
578
- google::protobuf::Timestamp start_timestamp;
579
- start_timestamp.set_seconds (time (NULL ));
580
- start_timestamp.set_nanos (0 );
578
+ auto start_time = time (NULL );
581
579
582
580
for (size_t i = 0 ; i < num_servers; i++) {
583
581
auto server = &servers[i];
@@ -630,9 +628,7 @@ std::unique_ptr<ScenarioResult> RunScenario(
630
628
bool client_finish_first =
631
629
(client_config.rpc_type () != STREAMING_FROM_SERVER);
632
630
633
- google::protobuf::Timestamp end_timestamp;
634
- end_timestamp.set_seconds (time (NULL ));
635
- end_timestamp.set_nanos (0 );
631
+ auto end_time = time (NULL );
636
632
637
633
FinishClients (clients, client_mark);
638
634
@@ -662,8 +658,8 @@ std::unique_ptr<ScenarioResult> RunScenario(
662
658
}
663
659
664
660
// Fill in start and end time for the test scenario
665
- result->mutable_summary ()->mutable_start_time ()->CopyFrom (start_timestamp );
666
- result->mutable_summary ()->mutable_end_time ()->CopyFrom (end_timestamp );
661
+ result->mutable_summary ()->mutable_start_time ()->set_seconds (start_time );
662
+ result->mutable_summary ()->mutable_end_time ()->set_seconds (end_time );
667
663
668
664
postprocess_scenario_result (result.get ());
669
665
return result;
0 commit comments