Commit 9cd7c3e24a2f55cb68a77b5242f6ff88706938cf

Authored by Perry Werneck
1 parent 7338ded5
Exists in master and in 1 other branch develop

Performance tests (windows).

src/core/calls.cc
... ... @@ -88,7 +88,7 @@
88 88  
89 89 HLLAPI_API_CALL hllapi_get_state(void) {
90 90  
91   - debug("",__FUNCTION__);
  91 +// debug("",__FUNCTION__);
92 92  
93 93 try {
94 94  
... ...
src/testprogram/testprogram.cc
... ... @@ -31,6 +31,7 @@
31 31 #include <getopt.h>
32 32 #include <cstring>
33 33 #include <cstdio>
  34 + #include <ctime>
34 35 #include <lib3270/hllapi.h>
35 36  
36 37 #define SCREEN_LENGTH 2000
... ... @@ -201,6 +202,45 @@
201 202 cout << "Searching for \"" << (cmdline.c_str()+5) << "\"" << endl;
202 203 rc = hllapi_find_text((LPSTR) (cmdline.c_str()+5));
203 204  
  205 + } else if(strcasecmp(cmdline.c_str(),"perftest") == 0) {
  206 +
  207 + if(!hllapi_is_connected()) {
  208 +
  209 + cout << "Connect to host first" << endl;
  210 +
  211 + } else {
  212 +
  213 + // Test "hllapi_wait_for_ready
  214 + cout << "Testing hllapi_wait_for_ready" << endl;
  215 + {
  216 + time_t start_time = time(0);
  217 + for(size_t ix = 0; ix < 100; ix++) {
  218 +
  219 + hllapi_wait_for_ready(10);
  220 +
  221 + }
  222 + cout << "Time for 100 iterations of hllapi_wait_for_ready was " << (time(0) - start_time) << " seconds" << endl;
  223 +
  224 + }
  225 +
  226 + // Teste hllapi_get_string_at
  227 + {
  228 + cout << "Testing hllapi_get_screen_at" << endl;
  229 + char buffer[81];
  230 + time_t start_time = time(0);
  231 + for(size_t ix = 0; ix < 100; ix++) {
  232 +
  233 + memset(buffer,' ',sizeof(buffer));
  234 + buffer[80] = 0;
  235 + hllapi_get_screen_at(14,1,buffer);
  236 +
  237 + }
  238 + cout << "Time for 100 iterations of hllapi_get_screen_at was " << (time(0) - start_time) << " seconds" << endl;
  239 +
  240 + }
  241 +
  242 + }
  243 +
204 244 } else {
205 245  
206 246 cout << "Unknown command \"" << cmdline << "\""<< endl;
... ...