summaryrefslogtreecommitdiff
path: root/src/tools/operf/operf.c
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2016-11-19 15:46:07 +0000
committerSander Vrijders <sander.vrijders@intec.ugent.be>2016-11-19 15:46:07 +0000
commitc39e0cbc5e5fd18625dea6522fbd389eb9dc871f (patch)
tree1489683642a77e8a860e88fecbc7484ea2ad901f /src/tools/operf/operf.c
parent1d39184abd7495bb3a2230ae8165bcf2cb2329fc (diff)
parent26b338bbb6d10ca19eabee2bcb0bdf9ef82bca63 (diff)
downloadouroboros-c39e0cbc5e5fd18625dea6522fbd389eb9dc871f.tar.gz
ouroboros-c39e0cbc5e5fd18625dea6522fbd389eb9dc871f.zip
Merged in dstaesse/ouroboros/be-operf (pull request #305)
tools: Use busy waiting in operf
Diffstat (limited to 'src/tools/operf/operf.c')
-rw-r--r--src/tools/operf/operf.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/tools/operf/operf.c b/src/tools/operf/operf.c
index b52109cf..46dfc14d 100644
--- a/src/tools/operf/operf.c
+++ b/src/tools/operf/operf.c
@@ -41,6 +41,7 @@ struct c {
int size;
long rate;
bool flood;
+ bool sleep;
int duration;
size_t sent;
@@ -81,6 +82,7 @@ static void usage(void)
" -r, --rate Rate (b/s)\n"
" -s, --size Payload size (B, default 1500)\n"
" -f, --flood Send SDUs as fast as possible\n"
+ " --sleep Sleep in between sending SDUs\n"
" --help Display this help text and exit\n");
}
@@ -100,6 +102,7 @@ int main(int argc, char ** argv)
server.timeout = 1000; /* ms */
client.rate = 1000000;
client.flood = false;
+ client.sleep = false;
while (argc > 0) {
if (strcmp(*argv, "-n") == 0 ||
@@ -127,6 +130,8 @@ int main(int argc, char ** argv)
} else if (strcmp(*argv, "-f") == 0 ||
strcmp(*argv, "--flood") == 0) {
client.flood = true;
+ } else if (strcmp(*argv, "--sleep") == 0) {
+ client.sleep = true;
} else if (strcmp(*argv, "-l") == 0 ||
strcmp(*argv, "--listen") == 0) {
serv = true;