1 #include <unistd.h> 2 3 constexpr int LOOP_COUNT = 100000000; 4 ParentFunction()5void ParentFunction() { 6 for (volatile int i = 0; i < LOOP_COUNT; ++i) { 7 } 8 } 9 ChildFunction()10void ChildFunction() { 11 for (volatile int i = 0; i < LOOP_COUNT; ++i) { 12 } 13 } 14 main()15int main() { 16 pid_t pid = fork(); 17 if (pid == 0) { 18 ChildFunction(); 19 return 0; 20 } else { 21 ParentFunction(); 22 } 23 return 0; 24 } 25