49 #include <visp/vpConfig.h>
54 # include <mmsystem.h>
61 #include <visp/vpTime.h>
62 #include <visp/vpParseArgv.h>
67 #define GETOPTARGS "h"
74 void usage(
const char *name,
const char *badparam)
88 fprintf(stdout,
"\nERROR: Bad parameter [%s]\n", badparam);
97 bool getOptions(
int argc,
const char **argv)
104 case 'h': usage(argv[0], NULL);
return false;
break;
107 usage(argv[0], optarg);
112 if ((c == 1) || (c == -1)) {
114 usage(argv[0], NULL);
115 std::cerr <<
"ERROR: " << std::endl;
116 std::cerr <<
" Bad argument " << optarg << std::endl << std::endl;
125 main(
int argc,
const char ** argv)
128 if (getOptions(argc, argv) ==
false) {
135 for (
int i =0 ; i < 100000; i ++)
136 for (
int j =0 ; j < 100; j ++)
138 std::cout <<
"Computed dummy value: " << v << std::endl;
178 std::cout <<
"t1-t0: computation time: " << t1 - t0 << std::endl;
179 std::cout <<
"t2-t1: wait(t1, 40 ms): " << t2 - t1 << std::endl;
180 std::cout <<
"t3-t2: sleep(10 ms): " << t3 - t2 << std::endl;
181 std::cout <<
"t4-t3: sleep(2 ms): " << t4 - t3 << std::endl;
182 std::cout <<
"t5-t4: wait(t, 19 ms): " << t5 - t4 << std::endl;
183 std::cout <<
"t6-t5: wait(5 ms): " << t6 - t5 << std::endl;
184 std::cout <<
"t7-t6: wait(21 ms): " << t7 - t6 << std::endl;
185 std::cout <<
"t8-t7: wait(2 ms): " << t8 - t7 << std::endl;