While capturing packets on Windows 7 x64, timestamps don't seem to have float precision. the code is given below.
from scapy.all import sniff
pkts = sniff(count=10)
pkts[0].time
-> for higher precision output
print('%.6f'%pkts[0].time)
output
1506009934
1506009934.000000
any ideas how to get precise values for timestamps?
print(type(pkts[0].time))
what do you get? – Mark Ransomscapy
and I can't find thetime
attribute in the documentation, so I don't know what units it's using. Sorry I can't help. – Mark Ransom1506018140.84
and usingprint('%.6f'%pkts[0].time)
I got1506018140.836040
for the same timestamp. – coder