Students in an engineering class at MIT have demonstrated the importance of getting enough sleep by wearing Fitbits all semester long. Those who got more sleep got considerably better marks on the quizzes and tests in the course.

There were a few surprises along the way.

One was that everyone seemed to have their own personal limit for bedtime. If they stayed up later, their performance suffered no matter how much sleep they got. While this time varied from student to student, it was around 2 a.m. for most of them.

There was a substantial association between the average amount of sleep a student got and their test performance, with more sleep meaning higher marks.

Another surprise was that the amount of sleep a student got the night before a test didn't seem to matter. There was no improvement in test scores seen for people who made sure to get a good night's sleep the night before an exam. It took several nights in a row of good sleep to make a difference. But getting a good night's sleep the entire week before a test did help.

What wasn't surprising was that students who got more sleep performed better on the 11 quizzes, three midterms and final exam. It was the extent of that performance boost that was surprising. There was a substantial association between the average amount of sleep a student got and their test performance, with more sleep meaning higher marks.

The amount of sleep wasn't the only factor. Consistency also mattered. People who slept about the same amount each night did better than those who had greater variation from night to night, even if they both ended up with the same average nightly amount of sleep. And the quality of sleep was also important.

These three factors accounted for about a quarter of the difference in performance among the students.

The 100 students were taking a chemistry course called Introduction to Solid State Chemistry. And they may have helped solve a problem that had been puzzling the course instructor for several years. Women in the class have repeatedly gotten better grades than the men. The reason for this was unclear. But it may possibly be due to their sleep habits.

In this group of 100 students, the women again outscored the men on tests and quizzes. They also had better overall sleep quality (but not quantity) and more consistency in sleep duration than the men. The difference in test scores between the sexes became insignificant once sleep quality was taken into account. So the course instructor now has one possible answer for why women do better in his class.

The findings suggest that it may be more important for men to stick to a regular sleep schedule than it is for women. That's one more topic men and women might find themselves discussing at two in the morning. Or they could just play it safe and just go to sleep instead.

The study appears in npj Science of Learning.