revise pipe example to evaluate context switch time