diff options
authorThomas Petazzoni <>2018-09-21 13:31:16 (GMT)
committerThomas Petazzoni <>2018-10-10 19:30:51 (GMT)
commitb2c24f584d163a6e5170f4a025aa1094b468527a (patch)
parentcf9344c45e85ed274cf783271344f4c03138971d (diff)
package/ increase precision of timestamps
Currently, the timestamps that we keep in build-time.log use a second-level precision. However, as we are going to introduce a new type of graph to draw the time line of a build, this precision is going to be insufficient, as a number of steps are so short that they are not even one second long, and generally the rounding to the second gives a not so great looking graph. Therefore, we add to the timestamps the nanoseconds using the %N date specifier. A milli-second precision would have been sufficient, but %N is all what date(1) provides at the sub-second level. Since this is changing the format of the build-time.log file, this commit adjusts the support/scripts/graph-build-time script accordingly, to account for the floating point numbers that we have as timestamps. Signed-off-by: Thomas Petazzoni <> Acked-by: "Yann E. MORIN" <> Signed-off-by: Thomas Petazzoni <>
2 files changed, 2 insertions, 2 deletions
diff --git a/package/ b/package/
index 91b61c6..daf2459 100644
--- a/package/
+++ b/package/
@@ -50,7 +50,7 @@ endef
# Time steps
define step_time
printf "%s:%-5.5s:%-20.20s: %s\n" \
- "$$(date +%s)" "$(1)" "$(2)" "$(3)" \
+ "$$(date +%s.%N)" "$(1)" "$(2)" "$(3)" \
diff --git a/support/scripts/graph-build-time b/support/scripts/graph-build-time
index 415d431..892e08b 100755
--- a/support/scripts/graph-build-time
+++ b/support/scripts/graph-build-time
@@ -260,7 +260,7 @@ def read_data(input_file):
return None
for row in reader:
- time = int(row[0].strip())
+ time = float(row[0].strip())
state = row[1].strip()
step = row[2].strip()
pkg = row[3].strip()