From 26b1ca4393e0cac46cc2ccbdca0f2d0c23b2ddac Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Wed, 17 Oct 2012 02:13:50 +0000 Subject: [PATCH] Incluindo teste de performance --- src/plugins/remotectl/testprogram.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/plugins/remotectl/testprogram.c b/src/plugins/remotectl/testprogram.c index a47f15a..aaa17e2 100644 --- a/src/plugins/remotectl/testprogram.c +++ b/src/plugins/remotectl/testprogram.c @@ -29,6 +29,7 @@ #include #include + #include #include #define BUFFER_LENGTH 8000 @@ -49,8 +50,8 @@ const char * arg; } cmd[] = { - { "ConnectPS", HLLAPI_CMD_CONNECTPS, "pw3270A" }, { "GetRevision", HLLAPI_CMD_GETREVISION, " " }, + { "ConnectPS", HLLAPI_CMD_CONNECTPS, "pw3270A" }, { "InputString", HLLAPI_CMD_INPUTSTRING, "test" }, }; @@ -72,6 +73,21 @@ hllapi((LPWORD) &fn,buffer,&len,&rc); printf("%s exits with rc=%d\n%s\n","HLLAPI_CMD_COPYPSTOSTR",rc,buffer); + // Performance + len = strlen(cmd[0].arg); + memcpy(buffer,cmd[0].arg,len); + if(hllapi((LPWORD) &cmd[0].fn,buffer,&len,&rc) == 0 && rc == 0) + { + time_t end = time(0) + 5; + int qtd = 0; + do + { + qtd++; + } while(hllapi((LPWORD) &cmd[0].fn,buffer,&len,&rc) == 0 && rc == 0 && time(0)