//...
unsigned int x, y;
//...
// somewhere inside ISR of timer 0:
x++;
//...
// main
// x = 0; // initialization
//...
// y = x;
//...