[openarena-data] 05/09: d/qvmbrute.c: Include timing information

Simon McVittie smcv at debian.org
Mon Oct 30 14:02:11 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch master
in repository openarena-data.

commit a671dbbc5103cb1ae2bf47f17f32b85ed6a58903
Author: Simon McVittie <smcv at debian.org>
Date:   Tue Oct 10 09:21:19 2017 +0100

    d/qvmbrute.c: Include timing information
---
 debian/changelog  |  1 +
 debian/qvmbrute.c | 10 ++++++++++
 2 files changed, 11 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index f0d1aca..f9e29dc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,7 @@ openarena-data (0.8.5split-10) UNRELEASED; urgency=medium
   * Move to debhelper compat level 10
   * Remove pre-generated QVM files from source package, so that building
     the package proves they can be regenerated
+  * d/qvmbrute.c: Include timing information
 
  -- Simon McVittie <smcv at debian.org>  Tue, 10 Oct 2017 09:03:33 +0100
 
diff --git a/debian/qvmbrute.c b/debian/qvmbrute.c
index a50dfd5..08634b4 100644
--- a/debian/qvmbrute.c
+++ b/debian/qvmbrute.c
@@ -14,18 +14,24 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <time.h>
 
 #include <zlib.h>
 
 int
 main (int argc, char **argv)
 {
+	struct timespec start = { 0 };
+	struct timespec end = { 0 };
 	u_int32_t i;
 	unsigned char qvm[1024] = { 0 };
 	u_int32_t target = strtoul (argv[1], NULL, 0);
 	char *subdir = "";
 	size_t fixed_len;
 	u_int32_t crc;
+	double delta;
+
+	clock_gettime (CLOCK_MONOTONIC, &start);
 
 	/* subdirectory to embed in the dummy file */
 	if (argc > 3) {
@@ -104,5 +110,9 @@ main (int argc, char **argv)
 		}
 	}
 
+	clock_gettime (CLOCK_MONOTONIC, &end);
+	delta = end.tv_sec - start.tv_sec + (end.tv_nsec - start.tv_nsec) / 1e9;
+	printf ("QVM file %s generated in %.2f seconds\n", argv[2], delta);
+
 	return 0;
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/openarena-data.git



More information about the Pkg-games-commits mailing list