If-statement vs function pointer

后端 未结 6 855
时光说笑
时光说笑 2021-01-04 14:22

The goal is to change the behaviour in an event loop, depending on whether a checkbox is toggled on or off. The simplest way, that I can think of, is just to test the checkb

6条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-04 15:01

    To get exact results, time measurements would be needed, but:
    I´m certain that a if has less overhead than a full function call.
    ->If is faster

提交回复
热议问题