[Client] make_packet(): time to ms only once

This commit is contained in:
Matteo Cypriani 2011-03-14 11:22:14 +01:00
parent 94e3701a51
commit fb8081f02e
1 changed files with 4 additions and 4 deletions

View File

@ -303,13 +303,14 @@ void make_packet()
{
uint_fast16_t offset ; // Index used to create the packet
TIMESTAMP request_time ;
uint_fast64_t request_time_ms ;
owl_timestamp_now(&request_time) ;
request_time_ms = owl_timestamp_to_ms(request_time) ;
if (is_calibration_request) // Calibration packet
{
printf("Calibration time: %"PRIu64"\n",
owl_timestamp_to_ms(request_time)) ;
printf("Calibration time: %"PRIu64"\n", request_time_ms) ;
offset = 0 ;
packet_size =
@ -334,8 +335,7 @@ void make_packet()
else // Standard packet
{
printf("Request time: %"PRIu64"\n",
owl_timestamp_to_ms(request_time)) ;
printf("Request time: %"PRIu64"\n", request_time_ms) ;
packet_size = sizeof(uint8_t) + sizeof(TIMESTAMP) ;
packet = malloc(packet_size) ;
memset(&packet[0], PACKET_TYPE_NORMAL, 1) ; // Packet type