Starting at "Inlet opens", follow the arrows around the figure of eight. In my case the cam is a 35-65, 65-35. so the inlet starts to open at 35deg BTDC (1). The next point will be TDC then the piston will go down to BDC (inlet stroke) At BDC the piston starts going up (compression stroke), 65deg after BDC the inlet valve closes(2). After TDC the piston starts down again (power stroke) and 65 deg before BDC the exhaust starts to open(3). After BDC the piston starts on the way up again (exhaust stroke) goes through TDC again and 35deg after TDC the exhaust closes (4). As you can see the inlet is opening again by now, thats the overlap. Duration is how long the valve is open, in this case 35+65+180=280 degrees.