Skip to content

Commit

Permalink
Add current unix timestamp in ms to message header
Browse files Browse the repository at this point in the history
  • Loading branch information
anjaldoshi committed May 22, 2023
1 parent ef21a89 commit 8f6d8b1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Source/ZmqInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ int ZmqInterface::sendData(float *data,

obj->setProperty("content", var(c_obj));
obj->setProperty("data_size", (int)(nSamples * sizeof(float)));
obj->setProperty("timestamp", Time::currentTimeMillis());

var json(obj);

Expand Down Expand Up @@ -504,6 +505,8 @@ int ZmqInterface::sendSpikeEvent(const SpikePtr spike)
c_obj->setProperty("threshold", t_var);

obj->setProperty("spike", var(c_obj));
obj->setProperty("timestamp", Time::currentTimeMillis());

var json (obj);
String s = JSON::toString(json);
void *headerData = (void *)s.toRawUTF8();
Expand Down Expand Up @@ -556,6 +559,7 @@ int ZmqInterface::sendEvent( uint8 type,

obj->setProperty("content", var(c_obj));
obj->setProperty("data_size", (int)numBytes);
obj->setProperty("timestamp", Time::currentTimeMillis());

var json (obj);
String s = JSON::toString(json);
Expand Down

0 comments on commit 8f6d8b1

Please sign in to comment.