Lines Matching refs:tm

22 profile_start(proftime_T *tm)  in profile_start()  argument
25 QueryPerformanceCounter(tm); in profile_start()
27 gettimeofday(tm, NULL); in profile_start()
35 profile_end(proftime_T *tm) in profile_end() argument
41 tm->QuadPart = now.QuadPart - tm->QuadPart; in profile_end()
44 tm->tv_usec = now.tv_usec - tm->tv_usec; in profile_end()
45 tm->tv_sec = now.tv_sec - tm->tv_sec; in profile_end()
46 if (tm->tv_usec < 0) in profile_end()
48 tm->tv_usec += 1000000; in profile_end()
49 --tm->tv_sec; in profile_end()
58 profile_sub(proftime_T *tm, proftime_T *tm2) in profile_sub() argument
61 tm->QuadPart -= tm2->QuadPart; in profile_sub()
63 tm->tv_usec -= tm2->tv_usec; in profile_sub()
64 tm->tv_sec -= tm2->tv_sec; in profile_sub()
65 if (tm->tv_usec < 0) in profile_sub()
67 tm->tv_usec += 1000000; in profile_sub()
68 --tm->tv_sec; in profile_sub()
78 profile_msg(proftime_T *tm) in profile_msg() argument
86 sprintf(buf, "%10.6lf", (double)tm->QuadPart / (double)fr.QuadPart); in profile_msg()
88 sprintf(buf, "%3ld.%06ld", (long)tm->tv_sec, (long)tm->tv_usec); in profile_msg()
98 profile_float(proftime_T *tm) in profile_float() argument
104 return (float_T)tm->QuadPart / (float_T)fr.QuadPart; in profile_float()
106 return (float_T)tm->tv_sec + (float_T)tm->tv_usec / 1000000.0; in profile_float()
115 profile_setlimit(long msec, proftime_T *tm) in profile_setlimit() argument
118 profile_zero(tm); in profile_setlimit()
124 QueryPerformanceCounter(tm); in profile_setlimit()
126 tm->QuadPart += (LONGLONG)((double)msec / 1000.0 * (double)fr.QuadPart); in profile_setlimit()
130 gettimeofday(tm, NULL); in profile_setlimit()
131 usec = (long)tm->tv_usec + (long)msec * 1000; in profile_setlimit()
132 tm->tv_usec = usec % 1000000L; in profile_setlimit()
133 tm->tv_sec += usec / 1000000L; in profile_setlimit()
142 profile_passed_limit(proftime_T *tm) in profile_passed_limit() argument
147 if (tm->QuadPart == 0) // timer was not set in profile_passed_limit()
150 return (now.QuadPart > tm->QuadPart); in profile_passed_limit()
152 if (tm->tv_sec == 0) // timer was not set in profile_passed_limit()
155 return (now.tv_sec > tm->tv_sec in profile_passed_limit()
156 || (now.tv_sec == tm->tv_sec && now.tv_usec > tm->tv_usec)); in profile_passed_limit()
164 profile_zero(proftime_T *tm) in profile_zero() argument
167 tm->QuadPart = 0; in profile_zero()
169 tm->tv_usec = 0; in profile_zero()
170 tm->tv_sec = 0; in profile_zero()
185 profile_divide(proftime_T *tm, int count, proftime_T *tm2) in profile_divide() argument
192 tm2->QuadPart = tm->QuadPart / count; in profile_divide()
194 double usec = (tm->tv_sec * 1000000.0 + tm->tv_usec) / count; in profile_divide()
213 profile_add(proftime_T *tm, proftime_T *tm2) in profile_add() argument
216 tm->QuadPart += tm2->QuadPart; in profile_add()
218 tm->tv_usec += tm2->tv_usec; in profile_add()
219 tm->tv_sec += tm2->tv_sec; in profile_add()
220 if (tm->tv_usec >= 1000000) in profile_add()
222 tm->tv_usec -= 1000000; in profile_add()
223 ++tm->tv_sec; in profile_add()
253 profile_get_wait(proftime_T *tm) in profile_get_wait() argument
255 *tm = prof_wait_time; in profile_get_wait()
262 profile_sub_wait(proftime_T *tm, proftime_T *tma) in profile_sub_wait() argument
266 profile_sub(&tm3, tm); in profile_sub_wait()
562 proftime_T *tm) // place to store wait time in script_prof_save() argument
572 profile_get_wait(tm); in script_prof_save()
623 proftime_T *tm) // place to store waittime in prof_child_enter() argument
629 script_prof_save(tm); in prof_child_enter()
638 proftime_T *tm) // where waittime was stored in prof_child_exit() argument
645 profile_sub_wait(tm, &fc->prof_child); // don't count waiting time in prof_child_exit()
649 script_prof_restore(tm); in prof_child_exit()
817 script_prof_restore(proftime_T *tm) in script_prof_restore() argument
827 profile_sub_wait(tm, &si->sn_pr_child); // don't count wait time in script_prof_restore()