[Git][NTPsec/ntpsec][master] Make ntpwait in verbose mode report seconds elapsed to fix.

Eric S. Raymond gitlab at mg.gitlab.com
Tue Aug 15 08:26:37 UTC 2017


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
8b42d9fb by Eric S. Raymond at 2017-08-15T04:25:01-04:00
Make ntpwait in verbose mode report seconds elapsed to fix.

- - - - -


1 changed file:

- ntpclients/ntpwait


Changes:

=====================================
ntpclients/ntpwait
=====================================
--- a/ntpclients/ntpwait
+++ b/ntpclients/ntpwait
@@ -155,6 +155,7 @@ if __name__ == "__main__":
     # Autoflush stdout
     sys.stdout = Unbuffered(sys.stdout)
 
+    basetime = time.time()
     if verbose:
         sys.stdout.write("Waiting for ntpd to synchronize...  ")
 
@@ -204,7 +205,7 @@ if __name__ == "__main__":
                     ntp.magic.LEAP_DELSECOND):
             # We could check "sync" here to make sure we like the source...
             if verbose:
-                sys.stdout.write("\bOK!\n")
+                sys.stdout.write("\bOK! (%d seconds)\n" % (time.time() - basetime))
             sys.exit(0)
 
         sys.stdout.write("\bUnexpected 'leap' status <%s>\n" % leap)



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/8b42d9fb38ee69d909bef3872b873bff11ef2123

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/8b42d9fb38ee69d909bef3872b873bff11ef2123
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170815/b9a23ae5/attachment.html>


More information about the vc mailing list