summaryrefslogtreecommitdiffstats
path: root/lz4demo.c
diff options
context:
space:
mode:
authoryann.collet.73@gmail.com <yann.collet.73@gmail.com@650e7d94-2a16-8b24-b05c-7c0b3f6821cd>2012-01-08 02:45:32 (GMT)
committeryann.collet.73@gmail.com <yann.collet.73@gmail.com@650e7d94-2a16-8b24-b05c-7c0b3f6821cd>2012-01-08 02:45:32 (GMT)
commit97abf013482c8a8041e5938a80ceede566ef7d9d (patch)
tree79c334fe7a00ba18a8be9372dc70f46276c591c9 /lz4demo.c
parentaac2572351dad4c48675091158620add2c0ff839 (diff)
downloadlz4-97abf013482c8a8041e5938a80ceede566ef7d9d.zip
lz4-97abf013482c8a8041e5938a80ceede566ef7d9d.tar.gz
lz4-97abf013482c8a8041e5938a80ceede566ef7d9d.tar.bz2
Added : benchmark function within command-line utility
git-svn-id: https://lz4.googlecode.com/svn/trunk@46 650e7d94-2a16-8b24-b05c-7c0b3f6821cd
Diffstat (limited to 'lz4demo.c')
-rw-r--r--lz4demo.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/lz4demo.c b/lz4demo.c
index e349485..c15b242 100644
--- a/lz4demo.c
+++ b/lz4demo.c
@@ -39,6 +39,7 @@
#include <fcntl.h> // _O_BINARY
#endif
#include "lz4.h"
+#include "bench.h"
//**************************************
@@ -82,7 +83,8 @@ int usage()
DISPLAY( "Arguments :\n");
DISPLAY( " -c : compression (default)\n");
DISPLAY( " -d : decompression \n");
- DISPLAY( " -t : test compressed file \n");
+ DISPLAY( " -b : benchmark with files\n");
+ DISPLAY( " -t : check compressed file \n");
DISPLAY( " -h : help (this text)\n");
DISPLAY( "input : can be 'stdin' (pipe) or a filename\n");
DISPLAY( "output : can be 'stdout'(pipe) or a filename or 'null'\n");
@@ -271,7 +273,8 @@ int main(int argc, char** argv)
{
int i,
compression=1, // default action if no argument
- decode=0;
+ decode=0,
+ bench=0;
char* input_filename=0;
char* output_filename=0;
#ifdef _WIN32
@@ -309,6 +312,9 @@ int main(int argc, char** argv)
// Decoding
if ( argument[0] =='d' ) { decode=1; continue; }
+ // Bench
+ if ( argument[0] =='b' ) { bench=1; continue; }
+
// Test
if ( argument[0] =='t' ) { decode=1; output_filename=nulmark; continue; }
}
@@ -328,6 +334,8 @@ int main(int argc, char** argv)
// No input filename ==> Error
if(!input_filename) { badusage(); return 1; }
+ if (bench) return BMK_benchFile(argv+2, argc-2);
+
// No output filename
if (!output_filename) { badusage(); return 1; }