Is there a metric for how much cognitive effort it takes a person to execute a task?

I'm curious if there is a branch of science that has tried to quantify the amount of attention or cognitive effort it takes to complete a task?

Some high/low examples:

  1. A musician performing on the road playing a song for the first time vs. playing a song for the hundredth time.
  2. A consumer faced with participating in an auction "Bid Now" vs purchasing a product with one button "Buy Now".
  3. A driver circling to find a parking space compared to just handing the keys to a valet.

All these tasks require presence, attention, and thought to accomplish something but vary greatly in how much bleeping energy they require.