Cleanup code that does waiting for process exit and elapsed time computation.
Merge pull request #40 from Dmitry-Me/cleanupwaitingandtimingcode

Cleanup code that does waiting for process exit and elapsed time computation