If it's mentally involved, I can do 40 mins followed by 40 mins of something dumb, repeated maybe 3 times.
If it's not too mentally involved but still somewhat entertaining, up to 12 hours.
If it's not mentally involved and it's boring too, I procrastinate till I have exactly enough time left to get the job done then I kill it.