Ghetto timing with global variables