summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/Replay.hpp4
-rw-r--r--tools/Stress.cpp4
-rw-r--r--wsd/TraceFile.hpp14
3 files changed, 11 insertions, 11 deletions
diff --git a/tools/Replay.hpp b/tools/Replay.hpp
index 28aa309a90..558fe275a3 100644
--- a/tools/Replay.hpp
+++ b/tools/Replay.hpp
@@ -146,7 +146,7 @@ protected:
}
const std::chrono::microseconds::rep deltaCurrent = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::steady_clock::now() - epochCurrent).count();
- const unsigned deltaFile = rec.getTimestampNs() - epochFile;
+ const unsigned deltaFile = rec.getTimestampUs() - epochFile;
const int delay = (_ignoreTiming ? 0 : deltaFile - deltaCurrent);
if (delay > 0)
{
@@ -264,7 +264,7 @@ protected:
}
epochCurrent = std::chrono::steady_clock::now();
- epochFile = rec.getTimestampNs();
+ epochFile = rec.getTimestampUs();
}
}
diff --git a/tools/Stress.cpp b/tools/Stress.cpp
index 383fc3e279..9928097308 100644
--- a/tools/Stress.cpp
+++ b/tools/Stress.cpp
@@ -399,8 +399,8 @@ public:
int64_t nextTime = -1;
while (nextTime <= 0) {
nextTime = std::chrono::duration_cast<std::chrono::microseconds>(
- std::chrono::nanoseconds(_next.getTimestampNs() - _reader.getEpochStart())
- + now - _start).count();
+ std::chrono::microseconds(_next.getTimestampUs() - _reader.getEpochStart())
+ + _start - now).count();
if (nextTime <= 0)
{
sendTraceMessage();
diff --git a/wsd/TraceFile.hpp b/wsd/TraceFile.hpp
index 9af1a1b879..c701af7bbb 100644
--- a/wsd/TraceFile.hpp
+++ b/wsd/TraceFile.hpp
@@ -38,7 +38,7 @@ public:
TraceFileRecord() :
_dir(Direction::Invalid),
- _timestampNs(0),
+ _timestampUs(0),
_pid(0)
{
}
@@ -55,9 +55,9 @@ public:
Direction getDir() const { return _dir; }
- void setTimestampNs(unsigned timestampNs) { _timestampNs = timestampNs; }
+ void setTimestampUs(unsigned timestampUs) { _timestampUs = timestampUs; }
- unsigned getTimestampNs() const { return _timestampNs; }
+ unsigned getTimestampUs() const { return _timestampUs; }
void setPid(unsigned pid) { _pid = pid; }
@@ -73,7 +73,7 @@ public:
private:
Direction _dir;
- unsigned _timestampNs;
+ unsigned _timestampUs;
unsigned _pid;
std::string _sessionId;
std::string _payload;
@@ -441,8 +441,8 @@ private:
_indexIn = advance(-1, TraceFileRecord::Direction::Incoming);
_indexOut = advance(-1, TraceFileRecord::Direction::Outgoing);
- _epochStart = _records[0].getTimestampNs();
- _epochEnd = _records[_records.size() - 1].getTimestampNs();
+ _epochStart = _records[0].getTimestampUs();
+ _epochEnd = _records[_records.size() - 1].getTimestampUs();
}
static bool extractRecord(const std::string& s, TraceFileRecord& rec)
@@ -462,7 +462,7 @@ private:
switch (record)
{
case 0:
- rec.setTimestampNs(std::atoi(s.substr(pos, next - pos).c_str()));
+ rec.setTimestampUs(std::atol(s.substr(pos, next - pos).c_str()));
break;
case 1:
rec.setPid(std::atoi(s.substr(pos, next - pos).c_str()));