Census At School, an online programme run by Auckland University, has found that half of all children are in bed by 8.30pm in Years 4 and 5 (aged 8-9), by 9pm in Years 6-7, 9.30pm in Year 8, 10pm in the first year of high school, 10.30pm in Years 10-11 and 11pm in the final two years of school.
Dee Muller, a researcher in Massey University's Sleep/Wake Research Centre, says those median sleep times are perfectly in line with recommended guidelines.
"On the whole, children are waking up at 7am," she notes. "As children get a little bit older, they are going to bed a little bit later, but it's all adding up to the right amount of sleep.
"But I had a look at the data, and there is obviously quite a wide range of sleep variations within that. So it's more that there would be a proportion of children sitting outside of what we'd recommend."
The Ministry of Health says children aged 5 to 13 need nine to 11 hours of sleep. Since half are awake by 7am at all ages, that means they should all be in bed by 10pm to get at least nine hours' sleep.
And indeed only 8 per cent of children go to bed after 10pm in Year 4, but that rises to 20 per cent by Year 7 and 40 per cent by Year 9.
Teenagers aged 14 to 17 need eight to 10 hours of sleep, so they should be in bed by 11pm. But 21 per cent of Year 10 students, rising to 38 per cent of those in Year 13, are going to bed later than that.
Muller, who has just completed a doctoral study on the social determinants of sleep in 900 Kiwi 3-year-olds, has found that the kids most at risk of not getting enough sleep, or getting lower-quality sleep, are in poorer families.
"What we know in adult sleep health is that most low socio-economic adults are at high risk of poor sleep health, and I found the same in my study which looked at the sleep of 3-year-olds," she says.
"I did interview the mums about this. What came through was that where families don't have adequate financial resources, it can make it really challenging to provide everything that a child needs for a good sleep.
"If people are living in poorer-quality housing, rental houses that are cold and damp, that does have an impact on children's sleep health."
Overcrowding, shift work, stress and even the impacts of racism can all affect the sleep of everyone in the household.
On top of that, Muller says screens have affected sleep patterns across the social spectrum. Our bodies are tuned to release sleep-inducing melatonin after dark, and can be upset by any bright light or the blue light of screens.
"I'm not allowed my phone when I go to bed," says Ricky. "Usually I put it down at 10pm and go to bed at 10.30."
Muller says the usual rules of being physically active and eating a healthy diet help with good sleep - a point Ricky acknowledges.
"I play basketball, and after a game or practice I do find I sleep better," he says.
Conversely, eating dinner late can upset sleep. Census At School shows a remarkable consistency of median dinner times at 6.30pm or 7pm throughout the school years, but with 19 per cent of high-schoolers eating at 8pm or later.
"The recommendation is not to eat a heavy meal straight before bed. The flipside is not to go to bed hungry, because that also makes it difficult to sleep," Muller says.
She says not getting enough good sleep can affect children's learning, mood and general health, but the signs may not be as obvious as yawning or nodding off as adults.
"With children, it can be really difficult to read those signs. They can really struggle to concentrate or sit still, be more hyperactive," she says.
"Often it can be a little bit difficult to separate it out, but it's well worth investigating a child's sleep if the question has been raised as to whether or not the child has ADHD [attention deficit hyperactivity disorder]."
She says some overseas research suggests that children are getting less sleep than they used to, although the findings are mixed.
"It's that whole shift to a 24/7 society," she says. "We are all likely to get a bit less sleep than we used to."