Add timestamp to CSV output for use in future reporting/graphing

This commit is contained in:
Chris Hardie 2015-01-23 16:32:33 -05:00
parent 2b18cc806d
commit 41ef911514
1 changed files with 3 additions and 0 deletions

View File

@ -29,6 +29,7 @@ import threading
import re
import signal
import socket
import datetime
# Used for bound_interface
socket_socket = socket.socket
@ -596,6 +597,8 @@ def speedtest():
'%(latency)s ms' % best)
else:
if args.csv:
reporttime = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
print_('%s,' % reporttime, end='')
print_('%(latency)s,' % best, end='')
else:
print_('Ping: %(latency)s ms' % best)