Cooldown Timer

I am trying to implement a cooldown timer for a character in a game I am creating now for spell casting. It works in that after you cast a spell you must wait 10 seconds to cast another, but it freezes the game until the timer reaches 10. Does anyone know how to fix this? My code for this after you cast the spell is
startTime = taskMgr.currentTime
elapsedTime = globalClock.getRealTime() - startTime
while(elapsedTime < 10):
elapsedTime = globalClock.getRealTime() - startTime
self.manaVal -= elapsedTime
self.mana.destroy()
self.mana = addNums(0.70, self.manaVal, .99, 0, 0)
print elapsedTime
if(elapsedTime >= 10):
self.manaVal = 0
self.mana.destroy()
self.mana = addNums(0.70, self.manaVal, .99, 0, 0)

have a look at the manual. section tasks.
there is the doMethodLater which allows you to execute a task after a specified ammount of wait time. while waiting the game will continue to work just like it should. should be what you need.