Can people multitask optimally? We use a dual-task paradigm in which participants had to enter digits while monitoring a randomly moving cursor. Participants earned points for entering digits correctly and were docked points if they let the cursor drift outside of a target area. The severity of the tracking penalty was varied between conditions. Participants therefore had to decide how long to leave the tracking task unattended. As expected, participants left the tracking task for longer when the penalty was less severe and also when the cursor moved less erratically. To test whether participants were adjusting their behavior in an optimal manner, observed behavior was compared to a prediction of the optimal visit duration for each condition. Overall, the degree of correspondence between the observed behavior and the predicted optimum was very good, suggesting that people can multitask in a near optimal fashion given explicit feedback on their performance