I answered 6-8 hours, although its rare they are adjacent hours of productivity. I am a student though, which may make me a little off-topic for this question, but it is time spent researching, designing, and implementing complex physical models in C++, Python, and/or Matlab (I'm a physicist, computational).
As I am a student... The hours can be very weird. I can walk around my room aimlessly, repeatedly, not capable of doing a single thing for entire hours. But then I sit down at my desk and churn out a few hundred lines of code and write up a report that uses the results of that code. "In-the-zone" can be anything from 3 hours to 6 consecutively, and what triggers it I do not know.
Some of my compatriots feel the need to fool themselves into working 12+ hours a day on their assorted homework/code-work... I try not to do this, and generally I'm very low-stress, because I know when I need to be I crank out pages upon pages of (hopefully high quality) empirical work (assuming I have the data). It's much less frazzling than "omg I can't see my friends or chill for even an hour for coffee... Because I have an exam on Monday". An hour never killed anyone :D
As I am a student... The hours can be very weird. I can walk around my room aimlessly, repeatedly, not capable of doing a single thing for entire hours. But then I sit down at my desk and churn out a few hundred lines of code and write up a report that uses the results of that code. "In-the-zone" can be anything from 3 hours to 6 consecutively, and what triggers it I do not know.
Some of my compatriots feel the need to fool themselves into working 12+ hours a day on their assorted homework/code-work... I try not to do this, and generally I'm very low-stress, because I know when I need to be I crank out pages upon pages of (hopefully high quality) empirical work (assuming I have the data). It's much less frazzling than "omg I can't see my friends or chill for even an hour for coffee... Because I have an exam on Monday". An hour never killed anyone :D
Just my 0.02