Created a function to compute the throughput