add timer

/mi timer -> get elapsed time
/mi treset -> reset timer

also changed /reset to /ireset (istances reset)
also set functions as local to prevent calling outside the script