1 #include <unistd.h> 2 3 constexpr int LOOP_COUNT = 100000000; 4 5 void ParentFunction() { 6 for (volatile int i = 0; i < LOOP_COUNT; ++i) { 7 } 8 } 9 10 void ChildFunction() { 11 for (volatile int i = 0; i < LOOP_COUNT; ++i) { 12 } 13 } 14 15 int 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