Added timing function (should replaced with annotation or macro).