Added $timeout as parameter

Moved $timeout to parameter of ping and measureTime