diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2014-12-04 18:43:32 +0100 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2014-12-04 18:43:32 +0100 |
commit | 720079063a4e97794dada308faac5834c0c2b067 (patch) | |
tree | a08ac3c9aee0df89c5870f59c308b23b9d971122 /src/workertest.c | |
parent | 8717001af5170c3b63f9db543986b87ea7dd2049 (diff) | |
download | biruda-720079063a4e97794dada308faac5834c0c2b067.tar.gz biruda-720079063a4e97794dada308faac5834c0c2b067.tar.bz2 |
adde a run time parameter to worktest
reading worker command now with parameters as in the shell
Diffstat (limited to 'src/workertest.c')
-rw-r--r-- | src/workertest.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/workertest.c b/src/workertest.c index 51fc717..34f571b 100644 --- a/src/workertest.c +++ b/src/workertest.c @@ -1,12 +1,13 @@ #include <stdio.h> +#include <stdlib.h> #include "port.h" -#define RUN_TIME 10 - -int main( void ) +int main( int argc, char *argv[] ) { - for( int i = 0; i < RUN_TIME; i++ ) { + int run_time = atoi( argv[1] ); + + for( int i = 0; i < run_time; i++ ) { char msg[1024]; snprintf( msg, sizeof( msg ), "Msg %d\n", i ); |