Hacker News new | past | comments | ask | show | jobs | submit login

Disclaimer: I'm going to reference a product I built.

The science of sleep is a strange thing. Sleep is ubiquitous (after all, everyone needs to sleep), and almost everyone I know complains of being tired, or constantly groggy, or stressed due to the limited amount of sleep that they get every night. I know this particularly well, because I suffer from mild insomnia that keeps me awake far later than I should be. I try to use this time well, to create projects, or to learn new things, or to read books, but after a certain time in the night, one's brain starts to become mostly useless -- knowledge isn't retained.

All of that is background for an experience I had in late 2010. As usual, I had been sleeping badly -- getting about 4.5 hours of solid sleep per night for several weeks -- and was feeling pretty terrible, as you might imagine. That night, however, and for whatever reason, I slept beautifully for eight hours... but when my alarm clock went off, I felt terrible. I felt worse than I'd felt on four and a half hours' sleep. How was this possible?

It really bothered me, especially because I'd been so happy that I finally slept a "normal" night's sleep. Did I have some other sleep disorder, maybe one that produced insomnia as just a symptom? I researched, and tried to figure out what was really happening. I couldn't stand the grogginess I felt every morning.

During my research, which lasted probably about a month, I realized that something that made a major impact on me was the stage of sleep during which I woke up. Since sleep cycles last about 90 minutes, I felt better waking up between cycles (4.5 hours is about 3 complete cycles) than waking up in the middle of a sleep cycle (8 hours is 5.3 cycles). It turned out that this phenomenon was called "sleep inertia."

For awhile, I'd try to time this myself. I'd take a piece of paper, and count backwards from the time I needed to wake up in between cycles, then add on some time to fall asleep. I started to notice incredibly less grogginess in the morning. My new technique was amazing.

I tried sharing it with some of my friends and colleagues whom I knew also had problems getting up in the morning (who doesn't?), but it turns out that doing even simple math (subtraction) was not an activity people wanted to do right before bed. I'm not a math guy myself, so I couldn't really blame them. The timing happened to work out that I was teaching myself jQuery at the time, so I figured I'd create a little webapp for myself and my friends to use. That's how http://sleepyti.me was born.

In November 2010, when Sleepyti.me first launched, I asked HN and later Reddit's /r/programming for advice related to design and usability -- I am not a web design guy. That helped, but I ended up keeping the minimalist design in place. This choice was partially because I think it looks nice and clean, and partially because I'm not very good at design... at all. Anything more complicated and it probably would have looked terrible, knowing my design skills.

The site, much to my surprise, caught on very quickly. Social networks (Twitter & StumbleUpon, mostly) as well as traditional media found it effective and intriguing. I ended up giving several interviews about the site, being featured in LifeHacker, and being overall far more popular than I'd ever imagined. For example, I received 300,912 visits to the site last week.

I don't allow donations, and I haven't released an official mobile app yet, but the single banner page on the site has done very well for me -- I've earned $1500-$2000 per month since early 2011. It's not a startup by any means, but it's certainly a nice way to bring in some extra income from a side project.

I think the point I'm trying to make is that the article is right: the science of sleep is strange, and at times counter-intuitive... but in my opinion, it's also an untapped market. After all, we all just want a good night's sleep, don't we?




This sounds like a gross oversimplification. For one thing - even if 90 minutes is the average length of a sleep cycle, this surely varies between humans. My sleep cycle might easily be 80 minutes or 100 minutes long, rather than 90. If I were to use sleepyti.me, it might recommend that I go to bed at 11:00pm to get up at 6:30am. But if my sleep cycle is only 80 minutes long, it will be 40 minutes out in its recommendation, which means that I would wake up in the middle of a sleep cycle, rather than at end of one - exactly the opposite of what it's supposed to achieve!

In addition, although the first sleep cycle averages 90 minutes, the second to fourth cycles are generally 100-120 minutes [1] which again throws off your calculations.

In short, I'm extremely sceptical that such a simple rule could ever be effective for most people.

[1] http://en.wikipedia.org/wiki/Sleep#Sleep_stages


300,912 people apparently disagree. Sometimes even gross oversimplifications are better than nothing at all.


That doesn't mean anything. You need a real study (placebo works great you know). crntaylor is right. The sleep stages differs a lot between individuals. You need to analyze brain waves in order to be more precise (you could also try to detect movements like the "Sleep as android" app on android. But that's far from perfect.)


No, in this case it's actually not. Mathematically. See your parent for proof. And please do not bring the "a billion flies can't be wrong" argument into this.


For me, it has everything to do with consistency. Then my brain adapts and is not in deep sleep when my alarm goes off.

Consistency can be the number of hours asleep or the time I get up, and takes about three days to set in. It gets even better if I break up my sleep into, say, 3 hour chunks; instead of just sleeping for multiples of three hours, I inform my body when it's time to start and stop sleep cycles by waking up for 20 minutes. It is supposedly more efficient because your brain on its own spends longer than necessary in between sleep cycles, which is a waste of time.

Just a few more ideas!


If you don't mind the question: what kind of activity do you need to have in a site to generate that kind of revenue from it? ($ 1500 - $ 2000). Is it something in the order of, say, 10k ad views per month, 100k, or something bigger like 1 million, or is any other interesting factor that needs to be considered?


I'm not the OP, but I've been running ad-supported sites since before the dotcom crash of 2000, so hopefully I have some useful insight on this.

As an extremely rough benchmark, assuming $1 - $2 per 1000 page views on most sites is a reasonable baseline. Not all sites will be able to get to this, and some will get to far more, based on monetisation methods, ad placement (VERY important and frequently undervalued), number of ads, and niche served. Generally, the value of the ads increases in direct proportion to the spending power of the audience and the extent to which they arrive on the site intending to spend money. Sites offering investment advice do very well on ad payouts - free Flash game sites, not so much (although they can make it up on volume).

So for $1500 - $2000, you should probably assume you'll need a million page views a month. Some experimentation with ad placement or a higher-value niche will reduce that. I do know of people who are generating at least that much revenue in ads with 100k page views a month, but that's in very specific, high-paying niches.


Thanks! very insightful


I use an alarm app called Sleep Cycle, which basically monitors my movement and tries to wake me up at a good time. Similar idea to what you're showing, but a bit more dynamic (which could be good or bad, I suppose). Any thoughts on the two approaches?

For anyone who cares, I recommend Sleep Cycle most highly, or anything that gets you awake at a time more suited to your natural rhythm than an arbitrary alarm clock, whether Mr. Shaw's solution or something else. The difference really is remarkable, just as he says.


Just wanted to say that I use sleepyti.me a few times a week to decide my alarm time. It's really great and the only reason I use it lesser now is because I can just calculate the sleep cycles in my head (yeah programmers/math people aren't your target audience :P). But hey! Thanks for a brilliant tool and an eye opening insight into sleep patterns.


Since sleep cycles last about 90 minutes, I felt better waking up between cycles (4.5 hours is about 3 complete cycles) than waking up in the middle of a sleep cycle (8 hours is 5.3 cycles). It turned out that this phenomenon was called "sleep inertia."

I read this too and while I've not been so good these past three weeks, prior to that I've been sleeping as close to exactly 7.5 hours as possible and for the first time ever, I was able to consistently get up at 6:30 each morning without tiredness or finding it hard to get up. I picked 7.5 hours so that I'd have a good long sleep to take me through busy & stressful days, but on nights when I wasn't able to get to bed by 11pm, I picked a shorter multiple of 90 minutes and it works just as well except that if its too short over all, I start feeling drowsly earlier in the day.

I really need to do this again.


A friend of mine, Omni5cience, made a nighttime- and mobile-friendly fork of Sleepyti.me:

http://omni5cience.github.com/sleepyti.me/

I made a buttonless varient of it that works like a clock (the wakeup times stay current):

http://sidnicious.github.com/sleepyti.me/

We both love Sleepyti.me and it’s awesome to hear that you’re making some money off of it. (If you’re uncomfortable with us keeping the same name drop one of us an email.)


When you first posted about sleepyti.me here on HN, I was enduring a long phase where I was having a particularly hard time falling asleep at night. I would often lie in bed for two or three hours before I finally drifted off. Compounding the issue was my tendency to constantly measure and analyze how long I'd been trying and how much sleep I would (not) get if I fell asleep "now", always comparing those figures with factoids from articles I'd read about how much sleep we need, sleep cycles, etc. Then I came across this line on sleepyti.me's results page:

"The average adult human takes fourteen minutes to fall asleep, so plan accordingly!"

Now, instead of measuring my sleeplessness by the hour or by the sleep cycle, I started measuring by multiples of fourteen: "Okay, it's only been 28 minutes since I got in bed. That's only two times the average." "Now I'm at ten times the average. This is ridiculous." I started harboring a grudge towards all those "average" people who could fall asleep so quickly. I wondered if I was enough of a statistical outlier to skew the average up to fifteen or even sixteen minutes. I even began to begrudge _you_ for including that seemingly innocent statistic on a website intended to help people sleep better. I had no idea who you were, but I hated you for lodging that figure in my subconscious. These were the racing, irrational thoughts of my addled, sleep-deprived brain.

At the same time, in part because of that bit of trivia on your site, I started realizing that I had a real problem. My lack of sleep was affecting my concentration, my work, my relationships, pointing inevitably towards a long downward spiral that I desperately wanted to avoid. I began to critically examine my sleeping patterns, my sleeping environment, what I did every night and every morning, my diet—my whole life, in fact. Over the course of the next few months, I experimented with every variable I could think of.

I'm proud to say that today, I'm sleeping better than ever. I'm able to fall asleep much more easily, and my overall mood and outlook has improved considerably. It's by no means perfect though—it's very much an ongoing, concerted effort. For those of you enduring a similar struggle for sleep, here are a few of the things that made the biggest difference for me:

- Don't get hung up on numbers. Stop counting the minutes that you're not sleeping. Easier said than done for many of us, I know, but it's huge. Place digital alarm clocks and the like out of sight from your bed, and resist the urge to check the time on your phone.

- If you're on the computer late at night, use f.lux to automatically adjust the color temperature of your screen. The bright light of your LCD screen can mess with your body's natural rhythms, and f.lux helps to counter that. It took me a little while to get used to it, but once I did, I noticed a marked decrease in the "racing mind" syndrome when I used my computer right before bed. Here's the link: http://stereopsis.com/flux/

- Avoid caffeine after lunchtime. (This one will vary widely for different people, but since I'm a caffeine lightweight, it's pretty early in the day. Find your own cutoff.) Also try different caffeinated drinks. For instance, if I drink coffee at any time of the day, I'll likely have trouble sleeping that night, so I drink black tea almost exclusively.

- Don't go to bed on an empty stomach. I can't fall asleep if I'm hungry.

- Read! I started reading in bed every single night about a year and a half ago, and it's my favorite way to shut my brain off at the end of the day. Of course, certain books are better to fall asleep to—the best ones will keep you interested without being so engaging that you can't put it down. (I made the mistake of starting the Hunger Games at about 1:00am a couple of weeks ago, and I ended up reading the entire thing that night. I only got two hours of sleep before work the next morning.) Find what works for you.

- If I'm still having trouble falling asleep after reading, I will often "replay" the last couple chapters of whatever I read in reverse. See if you can remember everything that just happened and work your way back to where you started that night. I read about this trick somewhere on the web (amongst a bunch of other tips that didn't help), and it seems to work wonders for me. If you don't read at night, try recounting your day (even the boring stuff) backwards instead.

- Don't beat yourself up if you still struggle to sleep. It's okay, and it _will_ get better. (On that note, please consider seeing a doctor if your sleeplessness persists!)

Finally, to David: Thank you for building sleepyti.me. It serves a simple but significant purpose, and it does so elegantly. And while it fed my irrational, sleep-deprived hatred of non-insomniacs for a little while, it also became a catalyst for real change in my life.


This is just personal experience, but I have a hunch that a lot of sleeplessness is also caused by weird schedules. In the weektime you get up at 6, you go out on Friday and sleep until noon, and then on Sunday get up by 10, and then back to 6 AM again on Monday. In high school and college, it used to take me about an hour to get to sleep, and I'd always wake up tired after hitting the snooze button for three, four times.

Since about half a year ago, I've been getting up every day at 6 (week or weekend and in the first weeks of trying this out, whether you're tired or not) and all my sleeping problems have disappeared. To make sure I don't think about it, I hit the shower first and then decide whether I want to go back to bed... which at that point, you never do. Not tired. Easy to fall asleep. Don't need caffeine in the morning to stay awake.

I know there's more to insomnia than just bad habits and I don't want to be the kind of guy who argues that sleep problems are "just inside of your head", but I do wonder whether the fact that sleep issues are so pervasive in our society might have to do with a lack of routine in most people's lives.


Don't go to bed on an empty stomach. I can't fall asleep if I'm hungry.

This is hugely bad advice. Consistently going to bed with anything other than an empty stomach can lead to acid reflux (GERD). This is especially so after having chocolate before bed time, since chocolate loosens the muscle between your stomach and esophagus and allows acid to enter the tender areas of your esophagus, causing scaring and pain.

I have severe issues with this because of years of laying down after eating dinner. The muscle referred to above, in my case, is permanently damaged, such that it won't close all the way. I have to be very careful what I do after eating. It will be this way for the rest of my life and it's a complete pain in the ass.

Not everyone experiences this, but many will. I strongly recommend people do not follow the parent comment's advice.


Thanks for the warning, but isn't consistently going to bed with a full stomach different from going to bed with a light snack every once in a while to make sure your stomach is not growling?


Yes, it is, but only if that snack doesn't include chocolate or peppermint or one of the other foods that enables reflux. Ibuprofen (as well as all the NSAIDs) do, too. If you are on any medication, check the info on it to see if it promotes reflux.


One thing I want to emphasize here is f.lux. It works. In fact it works brilliantly – it has had a profound effect on my sleep quality of the last year.


I personally have found that f.lux is insufficient. It does significantly tone down the amount of blue that my laptop screen puts out, but even when set to the most red-shifted setting possible, my laptop screen still puts out enough blue light to keep me from getting sleepy.


It has had a huge effect on my sleep as well. In fact, I jail broke my phone specifically to install f.lux and that's been even better.


"without being so engaging that you can't put it down"

I find re-reading (good, entertaining, no too serious) novels that I have already read before, works best. Since you have already read the thing previously, it's easier to put it down in the middle.


I'd love to try out f.lux but I am a little wary of installing a binary that messes with my xwindow settings. I wish the source was available...


There are in fact a number of free solutions...

IIRC redshift was the most developed of them when I looked into it a while back.

http://alternativeto.net/software/f46lux/?license=opensource


Nice! Thanks for the tip:

  dfc@ronin:~$ apt-cache search redshift 
  gtk-redshift - Adjusts the color temperature of your screen with GTK+ integration
  redshift - Adjusts the color temperature of your screen


Another thanks, the benefits are instantaneous, incredible.


Side note about f.lux. I installed f.lux on my windows XP laptop and it kind of messed up the settings. The funny thing is even after uninstalling f.lux, my laptop retained the brightness settings that were set by f.lux. (Thankfully, it is fixed now.) It also crashed a few times due to its memory consumption.

Issues highlighted in the FAQ page here. http://stereopsis.com/flux/faq.html


I use sleepyti.me quite often and it's helped me a lot. I remember about a year ago I found that sleeping ~6.5 hours or 9.5 hours felt way better than 7-8, but I never looked into why that was. After discovering your app, I now know why and how to combat all-day grogginess. So thank you.

If I get really involved in something and realise it's past my normal bed time, I'll check sleepyti.me and if it's close to a good time to fall asleep I'll take some melatonin and fall asleep, otherwise I think to myself "I'll have to survive on one less cycle tonight." and keep working.

By the way, in your research did you learn where the 8-hour myth originated?


Two words: Wake light. Simplest and single greatest natural cure for sleep inertia.

http://www.amazon.com/s/ref=nb_sb_noss_1?url=search-alias%3D...



Re http://sleepyti.me: One small issue is that sleep schedule is calculated after setting the hour and minutes, but before getting a chance to set the AM/PM.


I have to say, your tool is awesome. I used to use it all the time.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: