(* initialize the queue with size 1 *)
queueSize=1;
(* initialize time to 0 *) 
time=0;
(* loop while the queue has positive size *)
While[queueSize>0,
(* add 1 to the time *)
time+=1;
(* simulate the people entering the queue *) 
x=RandomVariate[PoissonDistribution[5]];
queueSize=queueSize+x;
(* simulate the people leaving the queue *) 
y =RandomVariate[PoissonDistribution[5]];
If[y>queueSize,queueSize=0,queueSize = queueSize-y];
(* print the status at this time step *) 
Print["at time ",time," the queue contains: ",queueSize]
]
(* print the final time *) 
Print["time until the queue is empty: ",time]