mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-26 23:59:48 +01:00
Fitting the grade line took 3 ms for 250 m of track, 30 ms for 1 km, 65 ms for 2 km and 200 ms for 4 km, and the preview of the lay tool and of the drag from a free end fitted it every frame, twice for the drag; on the terrain model the preview of some 800 m took 10 to 17 ms a frame, the cursor standing or not. Now the frame waits under 1.5 ms for 4 km. The formations of the tracks led into the terrain went through every chunk under them 0.3 s after each click, some 50 ms, while the cursor went on to the next point; they wait for the laying to end. The tracks laid and the terrain are the same as before. Selftests: perf logs the longest frame and those over 33 ms, fittime the time of the fit by length, terrainhash a hash of the chunks in memory.
47 lines
916 B
C++
47 lines
916 B
C++
/*
|
|
This Source Code Form is subject to the
|
|
terms of the Mozilla Public License, v.
|
|
2.0. If a copy of the MPL was not
|
|
distributed with this file, You can
|
|
obtain one at
|
|
http://mozilla.org/MPL/2.0/.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <algorithm>
|
|
#include <cstddef>
|
|
#include <string>
|
|
|
|
// what the groups of the self-test commands share, each group in a file of its own
|
|
namespace editor_selftest
|
|
{
|
|
|
|
// frames gone through the selftest, for the measurements of perf
|
|
inline std::size_t &frames()
|
|
{
|
|
static std::size_t count{0};
|
|
return count;
|
|
}
|
|
|
|
// the longest frame since the last perf, and the frames longer than 33 ms
|
|
inline double &frame_longest()
|
|
{
|
|
static double value{0.0};
|
|
return value;
|
|
}
|
|
|
|
inline std::size_t &frames_slow()
|
|
{
|
|
static std::size_t count{0};
|
|
return count;
|
|
}
|
|
|
|
inline std::string one_line(std::string Text)
|
|
{
|
|
std::replace(Text.begin(), Text.end(), '\n', ';');
|
|
return Text;
|
|
}
|
|
|
|
} // namespace editor_selftest
|