fix sendqueue sleep timing to use microseconds

This commit is contained in:
Stephen Birarda 2015-08-03 14:34:12 -07:00
parent 51b47a1212
commit 20f33b3b64
2 changed files with 3 additions and 2 deletions

View file

@ -250,7 +250,7 @@ void SendQueue::run() {
// sleep as long as we need until next packet send, if we can
auto now = high_resolution_clock::now();
auto microsecondDuration = (_lastSendTimestamp + microseconds(_packetSendPeriod)) - now;
auto microsecondDuration = duration_cast<microseconds>((_lastSendTimestamp + microseconds(_packetSendPeriod)) - now);
if (microsecondDuration.count() > 0) {
usleep(microsecondDuration.count());

View file

@ -44,7 +44,7 @@ const QCommandLineOption UNRELIABLE_PACKETS {
const QStringList STATS_TABLE_HEADERS {
"Send Rate (P/s)", "RTT(ms)", "CW (P)", "Send Period (us)",
"Received ACK", "Processed ACK", "Received LACK", "Received NAK", "Received TNAK",
"Sent ACK2", "Re-sent Packets"
"Sent ACK2", "Sent Packets", "Re-sent Packets"
};
UDTTest::UDTTest(int& argc, char** argv) :
@ -234,6 +234,7 @@ void UDTTest::sampleStats() {
QString::number(stats.events[udt::ConnectionStats::Stats::ReceivedNAK]).leftJustified(STATS_TABLE_HEADERS[++headerIndex].size()),
QString::number(stats.events[udt::ConnectionStats::Stats::ReceivedTimeoutNAK]).leftJustified(STATS_TABLE_HEADERS[++headerIndex].size()),
QString::number(stats.events[udt::ConnectionStats::Stats::SentACK2]).leftJustified(STATS_TABLE_HEADERS[++headerIndex].size()),
QString::number(stats.sentPackets).leftJustified(STATS_TABLE_HEADERS[++headerIndex].size()),
QString::number(stats.events[udt::ConnectionStats::Stats::Retransmission]).leftJustified(STATS_TABLE_HEADERS[++headerIndex].size())
};