1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-25 01:20:37 +00:00

rulegen:: tests:: use clock()

This commit is contained in:
Zeno Rogue 2021-08-24 00:34:35 +02:00
parent 9174a8210b
commit 4d127e824a

View File

@ -562,7 +562,7 @@ void test_current(string tesname) {
} }
int tstart = SDL_GetTicks(); int tstart = SDL_GetTicks();
auto begin = std::chrono::high_resolution_clock::now(); auto begin = clock(); // std::chrono::high_resolution_clock::now();
try { try {
generate_rules(); generate_rules();
status = "ACC"; status = "ACC";
@ -590,7 +590,7 @@ void test_current(string tesname) {
message = e.what(); message = e.what();
} }
auto end = std::chrono::high_resolution_clock::now(); auto end = clock(); // std::chrono::high_resolution_clock::now();
if(t_origin.size() && (draw_which & 2)) { if(t_origin.size() && (draw_which & 2)) {
restart_game_on(new hrmap_testproto); restart_game_on(new hrmap_testproto);
@ -652,7 +652,8 @@ void test_current(string tesname) {
case 'C': Out("code", qcode); case 'C': Out("code", qcode);
case 't': Out("try", try_count); case 't': Out("try", try_count);
case 'T': Out("T", tstart / 1000.); case 'T': Out("T", tstart / 1000.);
case 'P': Out("Tp", std::chrono::duration_cast<std::chrono::nanoseconds>(end-begin).count() / 1000000000.); // case 'P': Out("Tp", std::chrono::duration_cast<std::chrono::nanoseconds>(end-begin).count() / 1000000000.);
case 'P': Out("Tp", (end-begin) * 1. / CLOCKS_PER_SEC);
case 'y': Out("tree", isize(treestates)); case 'y': Out("tree", isize(treestates));
case 'a': Out("amin;amax", lalign(0, areas[0], ";", areas.back())); case 'a': Out("amin;amax", lalign(0, areas[0], ";", areas.back()));
case 'h': Out("shapes", isize(arb::current.shapes)); case 'h': Out("shapes", isize(arb::current.shapes));