Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- constexpr long positiveElseZero(long value){
- return value > 0 ? value : 0;
- }
- template<long count> __attribute__((always_inline)) inline void nop(){
- nop<positiveElseZero(count - 1)>();
- __asm__ __volatile__("nop\n\t");
- }
- template<> __attribute__((always_inline)) inline void nop<0>(){
- //nothing so the template recursion ends
- }
- void main() {
- nop<2000>();
- }
Advertisement
Add Comment
Please, Sign In to add comment