Or simply a loop that does those three operations one after the other... since they happen so fast, to the user they will look simultaneous.