create stopwatch prototype function