diff options
Diffstat (limited to 'source/core')
| -rw-r--r-- | source/core/slang-performance-profiler.cpp | 9 | ||||
| -rw-r--r-- | source/core/slang-performance-profiler.h | 4 |
2 files changed, 9 insertions, 4 deletions
diff --git a/source/core/slang-performance-profiler.cpp b/source/core/slang-performance-profiler.cpp index b480e1c8e..f08b4998d 100644 --- a/source/core/slang-performance-profiler.cpp +++ b/source/core/slang-performance-profiler.cpp @@ -31,11 +31,14 @@ namespace Slang } virtual void getResult(StringBuilder& out) override { - for (auto func : data) + char buffer[512]; + for (const auto& func : data) { - out << func.key << ": \t"; + memset(buffer, 0, sizeof(buffer)); + snprintf(buffer, sizeof(buffer), "[*] %30s", func.key); + out << buffer << " \t"; auto milliseconds = std::chrono::duration_cast< std::chrono::milliseconds >(func.value.duration); - out << func.value.invocationCount << "\t" << milliseconds.count() << "ms\n"; + out << func.value.invocationCount << " \t" << milliseconds.count() << "ms\n"; } } virtual void clear() override diff --git a/source/core/slang-performance-profiler.h b/source/core/slang-performance-profiler.h index 71b34d262..9895793c4 100644 --- a/source/core/slang-performance-profiler.h +++ b/source/core/slang-performance-profiler.h @@ -68,7 +68,9 @@ private: List<ProfileInfo> m_profilEntries; }; -#define SLANG_PROFILE PerformanceProfilerFuncRAIIContext _profileContext(__func__) +#define SLANG_PROFILE PerformanceProfilerFuncRAIIContext _profileContext(__func__) +#define SLANG_PROFILE_SECTION(s) PerformanceProfilerFuncRAIIContext _profileContext##s(#s) + } #endif |
