Not sure what is meant by benchmarking the spawning of processes, but the only processes that the code is keeping track of is the parent and child processes from the fork.
What should I be doing and or benchmarking?
-- Code Over View --
When the child process is created it is sent to the sub send_dk or sub send_ip. Both of these sub's do basically the same thing except one is for passing Datakit info to the Expect script ($swbt_dms) and the other passes IP info into the Expect script. The output from the Expect script is evaluated in the sub ck_results and then the code continues in the sub send_dk where depending on the results the child process hits an "exit" command.