From 314022a6938d64bad585250ace9850f8b770d486 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 15 Nov 2019 19:15:13 +0000 Subject: [PATCH] Leading zeros --- daemon.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/daemon.py b/daemon.py index 8a0cbbf9..0b9a3808 100644 --- a/daemon.py +++ b/daemon.py @@ -831,11 +831,19 @@ class PubServer(BaseHTTPRequestHandler): def _benchmarkGET(self,GETstartTime): if self.server.debug: - print('BENCHMARK GET|'+str(int((time.time()-GETstartTime)*1000))+'|'+self.path) + timeDiff=str(int((time.time()-GETstartTime)*1000)) + timeDiffLen=len(timeDiff) + for i in range(6-timeDiffLen): + timeDiff='0'+timeDiff + print('BENCHMARK GET|'+timeDiff+'|'+self.path) def _benchmarkPOST(self,POSTstartTime): if self.server.debug: - print('BENCHMARK POST|'+str(int((time.time()-POSTstartTime)*1000))+'|'+self.path) + timeDiff=str(int((time.time()-GETstartTime)*1000)) + timeDiffLen=len(timeDiff) + for i in range(6-timeDiffLen): + timeDiff='0'+timeDiff + print('BENCHMARK POST|'+timeDiff+'|'+self.path) def do_GET(self): GETstartTime=time.time()