Small benchmark mode tweaks and fixes
This commit is contained in:
parent
6330ed9d94
commit
c855a82a46
2 changed files with 3 additions and 5 deletions
|
|
@ -26,8 +26,6 @@ namespace vks
|
||||||
|
|
||||||
Benchmark() {
|
Benchmark() {
|
||||||
active = true;
|
active = true;
|
||||||
iterationTimes.resize(iterations);
|
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
AttachConsole(ATTACH_PARENT_PROCESS);
|
AttachConsole(ATTACH_PARENT_PROCESS);
|
||||||
FILE *stream;
|
FILE *stream;
|
||||||
|
|
@ -37,7 +35,7 @@ namespace vks
|
||||||
}
|
}
|
||||||
|
|
||||||
void run(std::function<void()> renderFunc) {
|
void run(std::function<void()> renderFunc) {
|
||||||
static uint32_t currIteration;
|
iterationTimes.resize(iterations);
|
||||||
for (uint32_t i = 0; i < iterations; i++) {
|
for (uint32_t i = 0; i < iterations; i++) {
|
||||||
for (uint32_t f = 0; f < framesPerIteration; f++) {
|
for (uint32_t f = 0; f < framesPerIteration; f++) {
|
||||||
auto tStart = std::chrono::high_resolution_clock::now();
|
auto tStart = std::chrono::high_resolution_clock::now();
|
||||||
|
|
|
||||||
|
|
@ -72,9 +72,9 @@ os.makedirs("./benchmark", exist_ok=True)
|
||||||
for example in EXAMPLES:
|
for example in EXAMPLES:
|
||||||
print("---- (%d/%d) Running %s in benchmark mode ----" % (CURR_INDEX+1, len(EXAMPLES), example))
|
print("---- (%d/%d) Running %s in benchmark mode ----" % (CURR_INDEX+1, len(EXAMPLES), example))
|
||||||
if platform.system() == 'Linux':
|
if platform.system() == 'Linux':
|
||||||
RESULT_CODE = subprocess.call("./%s %s ./benchmark/%s" % (example, ARGS, example), shell=True)
|
RESULT_CODE = subprocess.call("./%s %s ./benchmark/%s 5" % (example, ARGS, example), shell=True)
|
||||||
else:
|
else:
|
||||||
RESULT_CODE = subprocess.call("%s %s ./benchmark/%s" % (example, ARGS, example))
|
RESULT_CODE = subprocess.call("%s %s ./benchmark/%s 5" % (example, ARGS, example))
|
||||||
if RESULT_CODE == 0:
|
if RESULT_CODE == 0:
|
||||||
print("Results written to ./benchmark/%s.csv" % example)
|
print("Results written to ./benchmark/%s.csv" % example)
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue