[Git][NTPsec/ntpsec][master] Fix comment typo found by Hal: milli -> micro
Gary E. Miller
gitlab at mg.gitlab.com
Thu Mar 16 18:18:48 UTC 2017
Gary E. Miller pushed to branch master at NTPsec / ntpsec
Commits:
554d0dec by Gary E. Miller at 2017-03-16T11:18:28-07:00
Fix comment typo found by Hal: milli -> micro
- - - - -
2 changed files:
- include/timespecops.h
- ntpclients/ntpviz
Changes:
=====================================
include/timespecops.h
=====================================
--- a/include/timespecops.h
+++ b/include/timespecops.h
@@ -51,7 +51,7 @@
/* milliseconds per second */
#define MS_PER_S 1000
-/* seconds per microsecond */
+/* seconds per millisecond */
#define S_PER_MS 1.0e-3
/* microseconds per second */
=====================================
ntpclients/ntpviz
=====================================
--- a/ntpclients/ntpviz
+++ b/ntpclients/ntpviz
@@ -55,6 +55,11 @@ ntpviz: can't find the Python argparse module
""")
sys.exit(1)
+# believe it or not, Python has not way to make a simple constant!
+NS_PER_S = 1e9 # nano seconds per second
+S_PER_MS = 1.0e-3 # seconds per microsecond
+S_PER_NS = 1.0e-9 # seconds per nanosecond
+S_PER_US = 1.0e-6 # seconds per microsecond
# table to translate refclock names
refclock_name = {'127.127.28.0': 'SHM(0)',
@@ -218,8 +223,8 @@ class VizStats(ntp.statfiles.NTPStats):
# go to seconds
self.unit = "s"
- elif 1e-3 <= target:
- self.multiplier = 1e3
+ elif S_PER_MS <= target:
+ self.multiplier = MS_PER_S
if freq:
# go to ppb
self.unit = "ppb"
@@ -227,8 +232,8 @@ class VizStats(ntp.statfiles.NTPStats):
# go to millisec
self.unit = "ms"
- elif 1e-6 <= target:
- self.multiplier = 1e6
+ elif S_PER_US <= target:
+ self.multiplier = US_PER_S
if freq:
self.unit = "10e-12"
else:
@@ -236,7 +241,7 @@ class VizStats(ntp.statfiles.NTPStats):
self.unit = "µs"
else:
- self.multiplier = 1e9
+ self.multiplier = NS_PER_S
if freq:
self.unit = "10e-15"
else:
@@ -1109,7 +1114,7 @@ plot \
if 1e-5 > stats.percs["p99"] and -1e-5 < stats.percs["p1"]:
# go to nanosec
rnd1 = 9 # round to 1 ns boxes
- out['boxwidth'] = 1e-9
+ out['boxwidth'] = S_PER_NS
cnt = collections.Counter()
for value in values:
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/554d0dec62bd6a7b566feecdf27e19765a5f17b0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170316/0d59e05e/attachment.html>
More information about the vc
mailing list