| 553 | } |
| 554 | |
| 555 | int main(int argc, char *argv[]) |
| 556 | { |
| 557 | if (argc == 2) |
| 558 | { |
| 559 | rt_sscanf(argv[1], "%d", &loop_count); |
| 560 | } |
| 561 | else |
| 562 | { |
| 563 | loop_count = 1000; |
| 564 | } |
| 565 | |
| 566 | puts("Benchmark"); |
| 567 | printf("looping times: %d\n", loop_count); |
| 568 | |
| 569 | init_test(); |
| 570 | int endurance; |
| 571 | STOPWATCH(insert_test, endurance); |
| 572 | printf("Insertion: %d ms\n", endurance); |
| 573 | |
| 574 | randomize(dataset, loop_count); |
| 575 | STOPWATCH(search_test, endurance); |
| 576 | printf("Search: %d ms\n", endurance); |
| 577 | |
| 578 | randomize(dataset, loop_count); |
| 579 | STOPWATCH(delete_test, endurance); |
| 580 | printf("Delete: %d ms\n", endurance); |
| 581 | |
| 582 | cleanup(); |
| 583 | puts("Benchmark exit"); |
| 584 | return 0; |
| 585 | } |