According to John Frederick Coots and Haven Gillespie's Christmas classic, it's Santa Claus who knows when you've been sleeping, and knows when you're awake.
Søren Louv-Jansen has a pretty good idea as well.
The digital developer has developed a "simple" piece of source code that can read Facebook's Messenger app to determine when your contacts are most likely to be asleep and awake.
Louv-Jansen was fascinated by Facebook's ability to keep a record of when your friends are active, with the Messenger service giving you a precise time when they were last online. "I was curious about where this data was coming from," he writes on his blog, "and after some digging found... a list of user ids and timestamps of last activity."
He created a piece of software that can read this information from his Facebook account every ten minutes, gradually compiling a picture of when his friends (soon to be former friends) use the service.
"Many people visit Facebook as the first thing in the morning, and the last thing before going to bed. It is therefore possible to get a good impression of their sleeping habits (or lack thereof)," he explains.
There are two possible reactions to this impressive build. The first is to say "Well sure, most of my friends sleep between 11pm and wake around 7am. That's normal, and not a big deal." The second, as Louv-Jansen puts it, is to realise that we're leaving quite a telling digital footprint behind:
"Everybody I’ve shown this to have been equally fascinated and outraged by the accuracy with which it predicts their sleep habits. In this digital world we leave footprints where we go, and when we do it, without even thinking about it. Facebook might block this little 'hack', so your friends no longer can track you, but Facebook will always be able to do their own data analysis which is undoubtably way better than what I’ve come up with. They are likely using this data for profiling, and creating more user-specific ads."