According to David R. Henderson of the Library of Economics and Liberty, opportunity cost directly relates to the time and resources spent to complete a task. The more time someone spends on one activity, the less time he has for other activities. Therefore, more time spent on doing homework increases its opportunity cost because it leaves less time for other tasks.
Henderson defines the opportunity cost of a resource in economics as the value of the next-highest-valued alternative use of that resource. Resources can be time, money, energy or pleasure. The cost of using a resource arises from the value of what it could be used for instead. In the example of homework, the resources used are time and energy.
The time and energy spent doing homework could be spent doing something else such as reading a book for pleasure, watching a movie, spending time with family and friends, or completing another necessary task. The opportunity cost of doing homework then becomes the time and energy that could be used for something else. On the other hand, watching a movie has the opportunity cost of the time it takes that could be spent doing something else. Every activity has an opportunity cost because there are always alternative activities.