From e7449e8171150d513338aff27885ad751c047b3e Mon Sep 17 00:00:00 2001 From: cxl Date: Sun, 16 Sep 2018 22:51:18 +0000 Subject: [PATCH] .examples git-svn-id: svn://ultimatepp.org/upp/trunk@12280 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- examples/PainterExamples/PainterExamples.upp | 4 ++-- examples/PainterExamples/main.cpp | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/examples/PainterExamples/PainterExamples.upp b/examples/PainterExamples/PainterExamples.upp index 7f316ccd2..09cbdff1f 100644 --- a/examples/PainterExamples/PainterExamples.upp +++ b/examples/PainterExamples/PainterExamples.upp @@ -38,6 +38,6 @@ file Test.iml; mainconfig - "" = "GUI MT", - "" = "GUI"; + "" = "GUI", + "" = "GUI TIMING"; diff --git a/examples/PainterExamples/main.cpp b/examples/PainterExamples/main.cpp index 917c08f60..f9b80924c 100644 --- a/examples/PainterExamples/main.cpp +++ b/examples/PainterExamples/main.cpp @@ -57,7 +57,7 @@ void App::Print() void App::Benchmark() { double tm[2]; - for(int pass = 0; pass < 2; pass++) { + for(int pass = 0; pass < 1 + !!ctrl.mt; pass++) { int time0 = GetTickCount(); int n = 0; int time; @@ -72,7 +72,10 @@ void App::Benchmark() } tm[pass] = double(time - time0) / n; } - PromptOK(Format("ST %.2f ms, MT %.2f ms, ST/MT %.2f", tm[0], tm[1], tm[0] / tm[1])); + if(ctrl.mt) + PromptOK(Format("ST %.2f ms, MT %.2f ms, ST/MT %.2f", tm[0], tm[1], tm[0] / tm[1])); + else + PromptOK(Format("%.2f ms", tm[0])); } void App::Paint(Draw& w)