basic function of stopwatch