diff options
author | Bartosz Taudul <wolf.pld@gmail.com> | 2017-10-22 16:57:08 +0300 |
---|---|---|
committer | Bartosz Taudul <wolf.pld@gmail.com> | 2017-10-22 16:57:08 +0300 |
commit | 56d2842e2e80f8710a4abd9bcf008f0885b5bd11 (patch) | |
tree | 9e1def9a4e9910c072d579a8dae22ad05b5c4bf9 /test | |
parent | b72d4b05defc9cfa7f26f1dde1d2c80449eb69b2 (diff) |
Add depth test (fibonacci).
Diffstat (limited to 'test')
-rw-r--r-- | test/test.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/test.cpp b/test/test.cpp index 4de0ed55..d87439ed 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -99,6 +99,22 @@ void MessageTest() } } +static int Fibonacci( int n ) +{ + ZoneScoped; + if( n < 2 ) return n; + return Fibonacci( n-1 ) + Fibonacci( n-2 ); +} + +void DepthTest() +{ + for(;;) + { + std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) ); + Fibonacci( 15 ); + } +} + int main() { auto t1 = std::thread( TestFunction ); @@ -111,6 +127,7 @@ int main() auto t8 = std::thread( Plot ); auto t9 = std::thread( Plot ); auto t10 = std::thread( MessageTest ); + auto t11 = std::thread( DepthTest ); tracy::SetThreadName( t1, "First thread" ); tracy::SetThreadName( t2, "Second thread" ); @@ -122,6 +139,7 @@ int main() tracy::SetThreadName( t8, "Plot 1" ); tracy::SetThreadName( t9, "Plot 2" ); tracy::SetThreadName( t10, "Message test" ); + tracy::SetThreadName( t11, "Depth test" ); for(;;) { |