diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-08-11 21:21:56 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-08-11 21:21:56 +0000 |
commit | 3d7fefedc9ba60bd8e8448efe8b628446d958536 (patch) | |
tree | 61ce41a52cd6e7232cead77818ef265993b2427e /src/fragmentation/fragmentation.c | |
parent | 4a0398474db197abed243a123fb971fbeeffab4b (diff) | |
download | gnunet-3d7fefedc9ba60bd8e8448efe8b628446d958536.tar.gz gnunet-3d7fefedc9ba60bd8e8448efe8b628446d958536.zip |
changing time measurement from milliseconds to microseconds
Diffstat (limited to 'src/fragmentation/fragmentation.c')
-rw-r--r-- | src/fragmentation/fragmentation.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/fragmentation/fragmentation.c b/src/fragmentation/fragmentation.c index f859b32c7..39a5af814 100644 --- a/src/fragmentation/fragmentation.c +++ b/src/fragmentation/fragmentation.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | (C) 2009, 2011 Christian Grothoff (and other contributing authors) | 3 | (C) 2009-2013 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -180,7 +180,7 @@ transmit_next (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
180 | delay = GNUNET_BANDWIDTH_tracker_get_delay (fc->tracker, fsize); | 180 | delay = GNUNET_BANDWIDTH_tracker_get_delay (fc->tracker, fsize); |
181 | else | 181 | else |
182 | delay = GNUNET_TIME_UNIT_ZERO; | 182 | delay = GNUNET_TIME_UNIT_ZERO; |
183 | if (delay.rel_value > 0) | 183 | if (delay.rel_value_us > 0) |
184 | { | 184 | { |
185 | fc->task = GNUNET_SCHEDULER_add_delayed (delay, &transmit_next, fc); | 185 | fc->task = GNUNET_SCHEDULER_add_delayed (delay, &transmit_next, fc); |
186 | return; | 186 | return; |
@@ -207,7 +207,7 @@ transmit_next (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
207 | GNUNET_BANDWIDTH_tracker_consume (fc->tracker, fsize); | 207 | GNUNET_BANDWIDTH_tracker_consume (fc->tracker, fsize); |
208 | GNUNET_STATISTICS_update (fc->stats, _("# fragments transmitted"), 1, | 208 | GNUNET_STATISTICS_update (fc->stats, _("# fragments transmitted"), 1, |
209 | GNUNET_NO); | 209 | GNUNET_NO); |
210 | if (0 != fc->last_round.abs_value) | 210 | if (0 != fc->last_round.abs_value_us) |
211 | GNUNET_STATISTICS_update (fc->stats, _("# fragments retransmitted"), 1, | 211 | GNUNET_STATISTICS_update (fc->stats, _("# fragments retransmitted"), 1, |
212 | GNUNET_NO); | 212 | GNUNET_NO); |
213 | 213 | ||
@@ -367,8 +367,8 @@ GNUNET_FRAGMENT_process_ack (struct GNUNET_FRAGMENT_Context *fc, | |||
367 | /* normal ACK, can update running average of delay... */ | 367 | /* normal ACK, can update running average of delay... */ |
368 | fc->wack = GNUNET_NO; | 368 | fc->wack = GNUNET_NO; |
369 | ndelay = GNUNET_TIME_absolute_get_duration (fc->last_round); | 369 | ndelay = GNUNET_TIME_absolute_get_duration (fc->last_round); |
370 | fc->ack_delay.rel_value = | 370 | fc->ack_delay.rel_value_us = |
371 | (ndelay.rel_value / fc->num_transmissions + 3 * fc->ack_delay.rel_value) / 4; | 371 | (ndelay.rel_value_us / fc->num_transmissions + 3 * fc->ack_delay.rel_value_us) / 4; |
372 | fc->num_transmissions = 0; | 372 | fc->num_transmissions = 0; |
373 | /* calculate ratio msg sent vs. msg acked */ | 373 | /* calculate ratio msg sent vs. msg acked */ |
374 | ack_cnt = 0; | 374 | ack_cnt = 0; |
@@ -392,11 +392,11 @@ GNUNET_FRAGMENT_process_ack (struct GNUNET_FRAGMENT_Context *fc, | |||
392 | { | 392 | { |
393 | /* some loss, slow down proportionally */ | 393 | /* some loss, slow down proportionally */ |
394 | fprintf (stderr, "Prop loss\n"); | 394 | fprintf (stderr, "Prop loss\n"); |
395 | fc->msg_delay.rel_value = ((fc->msg_delay.rel_value * ack_cnt) / snd_cnt); | 395 | fc->msg_delay.rel_value_us = ((fc->msg_delay.rel_value_us * ack_cnt) / snd_cnt); |
396 | } | 396 | } |
397 | else if (1 < fc->msg_delay.rel_value) | 397 | else if (100 < fc->msg_delay.rel_value_us) |
398 | { | 398 | { |
399 | fc->msg_delay.rel_value--; /* try a bit faster */ | 399 | fc->msg_delay.rel_value_us -= 100; /* try a bit faster */ |
400 | } | 400 | } |
401 | fc->msg_delay = GNUNET_TIME_relative_min (fc->msg_delay, | 401 | fc->msg_delay = GNUNET_TIME_relative_min (fc->msg_delay, |
402 | GNUNET_TIME_UNIT_SECONDS); | 402 | GNUNET_TIME_UNIT_SECONDS); |