During my efforts to get back in shape I discovered HIIT, or High Intensity Interval Training. Of course, I thought! Just like the hill sprints we used to do during track and field back in school.
HIIT appeals to me over straight-up aerobic training because I enjoy pushing myself to the limit. (I was a sprinter, not a distance guy.) And hey, if the studies are to be believed, from a personal fitness perspective HIIT actually generates better results than aerobic training in less total time. Holy crap, what's not to love?
But enough of my ranting. The point of this post is that if you are a linux user and have a computer near your workout area, you might enjoy this python script to help you manage your HIIT sessions. The terminal output looks like so:
bthomson@ubuntu-wintendo:~$ python intervals.py
15 seconds to get ready!
Interval 1!
3...
2...
1...
Begin
Work for 15!
3...
2...
1...
Stop
Active rest for 30 seconds!
Get ready...
10 seconds!
Interval 2!
3...
2...
1...
Begin
Work for 15!
Better yet, if you have espeak installed, the tts system will speak the messages so you can focus on your workout. If you use Rockbox you'll probably recognize the voice.
I suspect this is far easier to use than any of the commercial HIIT timer devices on the market, but of course the catch is that you'll need a computer in your workout area. If you're doing sprints outside it's not going to help at all.
Anyway, the script:
# intervals.py
#
# See end of document for copyright notice.
#
# Important: eSpeak must be installed for tts capability.
#
# Adjust these parameters to suit your needs. All values are in seconds. Most
# important are 'work' and 'recovery', which are your work and recovery
# interval lengths.
startInterval = 1
leadin = 15 # minimum: 7 seconds
recovery = 30 # minimum: 12 seconds
work = 15 # minimum: 4 seconds
######################################
import os, sys, time
from threading import Thread
class spkThread(Thread):
def __init__ (self):
Thread.__init__(self)
self._active = True
self._speakText = None
def run(self):
while self._active:
if self._speakText:
os.system('espeak "%s"' % self._speakText)
self._speakText = None
else:
time.sleep(0.1)
def speak(self, text):
self._speakText = text
def terminate(self):
self._active = False
def printNSpeak(text):
spkThread.speak(text)
print text
def countdownFromThree():
print "3..."
spkThread.speak("3")
time.sleep(1)
print "2..."
spkThread.speak("2")
time.sleep(1)
print "1..."
spkThread.speak("1")
time.sleep(1)
spkThread = spkThread()
spkThread.start()
try:
interval = startInterval - 1
printNSpeak("%d seconds to get ready!" % leadin)
time.sleep(leadin - 6)
while 1:
interval += 1
printNSpeak("Interval %d!" % interval)
time.sleep(3)
countdownFromThree()
printNSpeak("Begin")
print "Work for %d!" % work
time.sleep(work - 3)
countdownFromThree()
printNSpeak("Stop")
time.sleep(3)
printNSpeak("Active rest for %d seconds!" % recovery)
time.sleep(recovery - 13)
printNSpeak("Get ready...")
time.sleep(3)
printNSpeak("10 seconds!")
time.sleep(6)
except KeyboardInterrupt:
spkThread.terminate()
finally:
spkThread.terminate()
# Copyright (c) 2009 Brandon Thomson, http://bthomson.com/
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED
# "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
# LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
I doubt there's enough interest in this kind of thing to justify a real open source project, but for me it gets the job done in a very stylish way. Enjoy!
Edit: Apparently Android phones support Python and TTS... That would be the ideal place to run some code like this.