22 |
#endif |
#endif |
23 |
#endif |
#endif |
24 |
|
|
25 |
#define LOOPREPEAT 10000 |
#define LOOPREPEAT 20000 |
26 |
|
|
27 |
|
|
28 |
static FILE *outfile; |
static FILE *outfile; |
499 |
if (re != NULL) free(re); |
if (re != NULL) free(re); |
500 |
} |
} |
501 |
time_taken = clock() - start_time; |
time_taken = clock() - start_time; |
502 |
fprintf(outfile, "Compile time %.2f milliseconds\n", |
fprintf(outfile, "Compile time %.3f milliseconds\n", |
503 |
((double)time_taken)/(4 * CLOCKS_PER_SEC)); |
((double)time_taken * 1000.0) / |
504 |
|
((double)LOOPREPEAT * (double)CLOCKS_PER_SEC)); |
505 |
} |
} |
506 |
|
|
507 |
re = pcre_compile((char *)p, options, &error, &erroroffset, tables); |
re = pcre_compile((char *)p, options, &error, &erroroffset, tables); |
587 |
extra = pcre_study(re, study_options, &error); |
extra = pcre_study(re, study_options, &error); |
588 |
time_taken = clock() - start_time; |
time_taken = clock() - start_time; |
589 |
if (extra != NULL) free(extra); |
if (extra != NULL) free(extra); |
590 |
fprintf(outfile, " Study time %.2f milliseconds\n", |
fprintf(outfile, " Study time %.3f milliseconds\n", |
591 |
((double)time_taken)/(4 * CLOCKS_PER_SEC)); |
((double)time_taken * 1000.0)/ |
592 |
|
((double)LOOPREPEAT * (double)CLOCKS_PER_SEC)); |
593 |
} |
} |
594 |
|
|
595 |
extra = pcre_study(re, study_options, &error); |
extra = pcre_study(re, study_options, &error); |
767 |
register int i; |
register int i; |
768 |
clock_t time_taken; |
clock_t time_taken; |
769 |
clock_t start_time = clock(); |
clock_t start_time = clock(); |
770 |
for (i = 0; i < 4000; i++) |
for (i = 0; i < LOOPREPEAT; i++) |
771 |
count = pcre_exec(re, extra, (char *)dbuffer, len, options, offsets, |
count = pcre_exec(re, extra, (char *)dbuffer, len, options, offsets, |
772 |
size_offsets); |
size_offsets); |
773 |
time_taken = clock() - start_time; |
time_taken = clock() - start_time; |
774 |
fprintf(outfile, "Execute time %.2f milliseconds\n", |
fprintf(outfile, "Execute time %.3f milliseconds\n", |
775 |
((double)time_taken)/(4 * CLOCKS_PER_SEC)); |
((double)time_taken * 1000.0)/ |
776 |
|
((double)LOOPREPEAT * (double)CLOCKS_PER_SEC)); |
777 |
} |
} |
778 |
|
|
779 |
count = pcre_exec(re, extra, (char *)dbuffer, len, options, offsets, |
count = pcre_exec(re, extra, (char *)dbuffer, len, options, offsets, |