1.4 KiB
1.4 KiB
Sleep calc
Silly script in Lua to help me with sleep planing. Should work well in termux. Developed with Lua5.3 should work in any Lua5
What it does:
It prints what are the best times to wake up and duration of sleep when presented wake up times are used. Like this:
$ # now it's 01:34; we expect to fall asleep in 5 minutes
$ ./sleepCalc.lua 5
If gonna fall sleep at: 01:39
Wake up | to sleep
------------------
03:04 | 01h30m
04:34 | 03h00m
06:04 | 04h30m
07:34 | 06h00m
09:04 | 07h30m
10:34 | 09h00m
12:04 | 10h30m
13:34 | 12h00m
Usage
-
Two (optional) positional arguments
-
Number of minutes you estimate it will take you to fall asleep
- Default is 40 because I'm the only expected audience and I always to pray to Luna & Celestia before sleep
-
How many minutes one sleep cycle takes
- Default is 90minutes
-
Notice
- Don't quote me on this I haven't actually done any research in this area
- This is just summarized knowledge I collected from randoms on the internet
- Most of it is probably wrong or oversimplified
- Total amount of research that went into this is < 5
- I just did it a few times and felt it actually worked (could be placebo)
Basic ideas
- Ideal power nap is 20min
- Light sleep part of sleep is every 1h30m
- if you wake up in some multiple of 90 minutes, you should feel fresh a well rested