BIF_RETTYPE hipe_bifs_shared_gc_timer_0(BIF_ALIST_0) { #ifdef __BENCHMARK__ Eterm *hp; uint min = 0; uint sec = 0; uint milli = 0; uint micro = 0; Eterm minor, major, max_min, max_maj; hp = HAlloc(BIF_P, 4 * 4 + 5); MAKE_TIME(minor_global_gc); minor = TUPLE3(hp, make_small(min), make_small(sec), make_small(milli)); hp += 4; MAKE_TIME(major_global_gc); major = TUPLE3(hp, make_small(min), make_small(sec), make_small(milli)); hp += 4; MAKE_MICRO_TIME(max_global_minor); max_min = TUPLE3(hp, make_small(sec), make_small(milli), make_small(micro)); hp += 4; MAKE_MICRO_TIME(max_global_major); max_maj = TUPLE3(hp, make_small(sec), make_small(milli), make_small(micro)); hp += 4; BIF_RET(TUPLE4(hp, minor, major, max_min, max_maj)); #else BIF_RET(am_false); #endif }
BIF_RETTYPE hipe_bifs_misc_timer_0(BIF_ALIST_0) { #ifdef __BENCHMARK__ uint min = 0; uint sec = 0; uint milli = 0; Eterm *hp; Eterm misctime1, misctime2, misctime3; hp = HAlloc(BIF_P, 4 * 4); MAKE_TIME(misc0); misctime1 = TUPLE3(hp, make_small(min), make_small(sec), make_small(milli)); hp += 4; MAKE_TIME(misc1); misctime2 = TUPLE3(hp, make_small(min), make_small(sec), make_small(milli)); hp += 4; MAKE_TIME(misc2); misctime3 = TUPLE3(hp, make_small(min), make_small(sec), make_small(milli)); hp += 4; BIF_RET(TUPLE3(hp, misctime1, misctime2, misctime3)); #else BIF_RET(am_false); #endif }
BIF_RETTYPE hipe_bifs_send_timer_0(BIF_ALIST_0) { #ifdef __BENCHMARK__ uint min = 0; uint sec = 0; uint milli = 0; Eterm *hp; Eterm sendtime, copytime, sizetime; hp = HAlloc(BIF_P, 4 * 4); MAKE_TIME(send); sendtime = TUPLE3(hp, make_small(min), make_small(sec), make_small(milli)); hp += 4; MAKE_TIME(copy); copytime = TUPLE3(hp, make_small(min), make_small(sec), make_small(milli)); hp += 4; MAKE_TIME(size); sizetime = TUPLE3(hp, make_small(min), make_small(sec), make_small(milli)); hp += 4; BIF_RET(TUPLE3(hp, sendtime, copytime, sizetime)); #else BIF_RET(am_false); #endif }
BIF_RETTYPE hipe_bifs_system_timer_0(BIF_ALIST_0) { #ifdef __BENCHMARK__ uint min = 0; uint sec = 0; uint milli = 0; Eterm *hp; hp = HAlloc(BIF_P, 4); MAKE_TIME(system); BIF_RET(TUPLE3(hp, make_small(min), make_small(sec), make_small(milli))); #else BIF_RET(am_false); #endif }
/*----------------------------------------------------------------------------*/ static long timer_to_time(time_t time_secs) { struct tm *time_struct; if (time_secs == 0) { return 0; } else { /* Convert into a long value HHMMSS00 */ time_struct = localtime (&time_secs); if (time_struct) { return (MAKE_TIME (time_struct-> tm_hour, time_struct-> tm_min, time_struct-> tm_sec, 0)); } else { return 0; } } }