I have 2 modules, the first one is generating ingestion_time
as shown below
Long ingestion_time = System.currentTimeMillis();
The sample output of this ingestion_time
is
ingestion_time = 446453570778734
Now I have the second module in python which is generating detection_time for the same event as shown below
detection_time = time.time()
The sample output of this detection_time
is
detection_time = 1524807106.92
I want to have them in the same format so that I can get latency as
latency = detection_time - ingestion_time
Both modules are on the same system.
Please help!
Edit 1
by using
now = long(time.time())
print "detection_time = %s "%now
I get detection_time
as
detection_time = 1524808352
which is still not comparable with generation_time
as the number of digits is different
generation_time = 1524808352170
Answer
using below-mentioned code solved my issue
now = int(round(time.time() * 1000))
print "detection_time = %s "%now