Skip to main content
Code Review

Return to Answer

replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
  • Read this question this question regarding the proper use of inline. If you get very similar results between the two Fibonacci functions, this may explain it.

  • Instead of abbreviating one function to fib(), name it inline_fibonacci() or something similar. It'll at least make the function calls less-confusing.

  • timedFibonacci() seems to be doing a little too much. Consider returning the final times and having main() print them.

  • If you won't need those commented-out lines, then remove them. Don't clutter the code.

  • Since the times are in double, it's not very likely that you'll get the exact same times.

  • Read this question regarding the proper use of inline. If you get very similar results between the two Fibonacci functions, this may explain it.

  • Instead of abbreviating one function to fib(), name it inline_fibonacci() or something similar. It'll at least make the function calls less-confusing.

  • timedFibonacci() seems to be doing a little too much. Consider returning the final times and having main() print them.

  • If you won't need those commented-out lines, then remove them. Don't clutter the code.

  • Since the times are in double, it's not very likely that you'll get the exact same times.

  • Read this question regarding the proper use of inline. If you get very similar results between the two Fibonacci functions, this may explain it.

  • Instead of abbreviating one function to fib(), name it inline_fibonacci() or something similar. It'll at least make the function calls less-confusing.

  • timedFibonacci() seems to be doing a little too much. Consider returning the final times and having main() print them.

  • If you won't need those commented-out lines, then remove them. Don't clutter the code.

  • Since the times are in double, it's not very likely that you'll get the exact same times.

Source Link
Jamal
  • 35.2k
  • 13
  • 134
  • 238
  • Read this question regarding the proper use of inline. If you get very similar results between the two Fibonacci functions, this may explain it.

  • Instead of abbreviating one function to fib(), name it inline_fibonacci() or something similar. It'll at least make the function calls less-confusing.

  • timedFibonacci() seems to be doing a little too much. Consider returning the final times and having main() print them.

  • If you won't need those commented-out lines, then remove them. Don't clutter the code.

  • Since the times are in double, it's not very likely that you'll get the exact same times.

lang-cpp

AltStyle によって変換されたページ (->オリジナル) /