How is duration of visit calculated?

Does it actually time from the time they enter to the time they leave the site? I’m thinking that can’t be true and therefore am thinking that it is the time in-between actions or something like that. Can anyone shed some light on this? Thanks!

Yes, this is the time between the first action and the last action.