File: function_recursive.cpp

package info (click to toggle)
android-platform-system-extras 10.0.0%2Br36%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 21,588 kB
  • sloc: cpp: 45,171; python: 10,047; ansic: 8,169; sh: 4,029; java: 2,239; javascript: 1,752; xml: 991; asm: 169; makefile: 13
file content (18 lines) | stat: -rw-r--r-- 313 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
constexpr int LOOP_COUNT = 5000000;

void FunctionRecursive(int loop) {
  for (volatile int i = 0; i < LOOP_COUNT; ++i) {
  }
  if (loop > 0) {
    FunctionRecursive(loop - 1);
  }
  for (volatile int i = 0; i < LOOP_COUNT; ++i) {
  }
}

int main() {
  while (true) {
    FunctionRecursive(10);
  }
  return 0;
}