If you learned the Queueing theorem, You certainly remember the basic model, M/M/1. This is the source code of it.