Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Exception Cost Test - C++

Author

anonymous

about 2 years ago

Language

C++

Compiler

gcc 12.2.0

Options
Warnings
Boost 1.81.0
C++2b(GNU)
no pedantic

Exception Cost Test - C++

Author

anonymous

about 2 years ago

$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.81.0-gcc-12.2.0/include -std=gnu++2b
prog.cc: In function 'void measureNoExceptionCost(int, double)':
prog.cc:52:9: warning: unused variable 'exceptions' [-Wunused-variable]
   52 |     int exceptions = 0;
      |         ^~~~~~~~~~
measureNoExceptionCost: NoExceptions: 1000000, Duration: 5.83594 ms
measureExceptionCost: Probability: 0%, Exceptions: 0, NoExceptions: 1000000, Duration: 5.8726 ms
measureExceptionCost: Probability: 1%, Exceptions: 9990, NoExceptions: 990010, Duration: 17.5064 ms
measureExceptionCost: Probability: 99%, Exceptions: 990056, NoExceptions: 9944, Duration: 1058.56 ms
Exit Code:
0