From 9445ddff205f082942129a0273a041f9359f8bd6 Mon Sep 17 00:00:00 2001 From: "Rob Kendrick (monotony)" Date: Thu, 11 Oct 2012 19:59:16 +0100 Subject: clock() does not return centiseconds in the real world. --- squeeze.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'squeeze.c') diff --git a/squeeze.c b/squeeze.c index ea0122c..e911cef 100644 --- a/squeeze.c +++ b/squeeze.c @@ -161,7 +161,10 @@ int wf_save(char *filename, void *ptr, int len) static int ticks(void) { int last; - last = lastticks; lastticks = clock(); return(lastticks-last); + last = lastticks; + lastticks = (clock() * 100) / CLOCKS_PER_SEC; + + return(lastticks-last); } static int fileinfo(_kernel_osfile_block *info, const char *name) @@ -888,7 +891,7 @@ static int squeeze(char *in, char *out) else top = compress(code, size, info.exec - info.load); if (top != NULL) { - t = clock() - t; + t = ((clock() * 100) / CLOCKS_PER_SEC) - t; if (isdata) { d->bl_decompress = code[0] + DATAWORDS; /* dirty... */ code -= DATAWORDS; -- cgit v1.2.3