It tries to mantain a frame ratio of 60fps. If It can't, it just puts 0 in the timeout interval ("as soon as possible*").
A frame rate of 60fps is 1/60 sec = ~0.01666.. sec = ~ 16 ms
per frame.
(currTime - lastTime)
is the time since the last frame was displayed, so 16 - (currTime - lastTime)
is the time you should schedule the next frame if you want to mantain a 16 msec - or 60fps - delay between frames.
If the last frame took more than 16 msec to display, 16 - (currTime - lastTime)
is negative (it roughly means that you should have displayed the frame 16 - (currTime - lastTime)
msecs ago). In ths case, you just schedule the next frame to be displayed as soon as possible, since you can't go back in time :D
*EDIT: it should be, more precisely, "as soon as the rendering has catched up", see this question for further details.