"If I had six hours to chop down a tree, I'd spend the first four hours sharpening the axe." --Abraham Lincoln
http://lifehacker.com/5814019/work-smarter-and-more-easily-by-sharpening-your-axe
Lincoln's advice is generally applicable to computer programs, chess, businesses, and more. I typically spend a large (even huge) amount of time on the opening as soon as the game goes out of book since everything stems from those opening moves, and that is where the game's outcome is often decided. Once I've assessed well that first out-of-book position and any subsequent mistakes I pretty much know how the game will go, which traps will arise, what kind of endgame will ensue, and so on, therefore I can play much more quickly from then on. So far that method of budgeting time has worked fairly well for me.
If u r in time trouble dont panic. Try to think in ur opponents time and never ataack when u r in time trouble. If ur too defensive then be defensive. Try to recover dont look at the clock as it can waste 2-3 seconds.A best example is Magnus Carlsen vs Hou Yifan at the tata steel chess tournament 2015.
Carlsen had only 14 minutes for 10 moves and at last it was 3 min for 1 move. So follow this valuable piece if ur interested.
For any piece of advice message me with subject 'advice'.Thanks!