| 68 | //--------------------------------------------------------------------------------------// |
| 69 | |
| 70 | int cpp_main(int argc, char* argv[]) |
| 71 | { |
| 72 | if (argc != 2) |
| 73 | { |
| 74 | cout << "Usage: path_times <cycles-in-millions>\n"; |
| 75 | return 1; |
| 76 | } |
| 77 | |
| 78 | max_cycles = std::atoi(argv[1]) * 1000000LL; |
| 79 | cout << "testing " << std::atoi(argv[1]) << " million cycles" << endl; |
| 80 | |
| 81 | cout << "time_loop" << endl; |
| 82 | nanosecond_type x = time_loop(); |
| 83 | |
| 84 | cout << "time_ctor with string" << endl; |
| 85 | nanosecond_type s = time_ctor(std::string("/foo/bar/baz")); |
| 86 | |
| 87 | cout << "time_ctor with wstring" << endl; |
| 88 | nanosecond_type w = time_ctor(std::wstring(L"/foo/bar/baz")); |
| 89 | |
| 90 | if (s > w) |
| 91 | cout << "narrow/wide CPU-time ratio = " << long double(s) / w << endl; |
| 92 | else |
| 93 | cout << "wide/narrow CPU-time ratio = " << long double(w) / s << endl; |
| 94 | |
| 95 | cout << "returning from main()" << endl; |
| 96 | return 0; |
| 97 | } |