MCPcopy Create free account
hub / github.com/esnet/iperf / tmr_create

Function tmr_create

src/timer.c:121–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119
120
121Timer*
122tmr_create(
123 struct iperf_time* nowP, TimerProc* timer_proc, TimerClientData client_data,
124 int64_t usecs, int periodic )
125{
126 struct iperf_time now;
127 Timer* t;
128
129 getnow( nowP, &now );
130
131 if ( free_timers != NULL ) {
132 t = free_timers;
133 free_timers = t->next;
134 } else {
135 t = (Timer*) malloc( sizeof(Timer) );
136 if ( t == NULL )
137 return NULL;
138 }
139
140 t->timer_proc = timer_proc;
141 t->client_data = client_data;
142 t->usecs = usecs;
143 t->periodic = periodic;
144 t->time = now;
145 iperf_time_add_usecs(&t->time, usecs);
146 /* Add the new timer to the active list. */
147 list_add( t );
148
149 return t;
150}
151
152
153struct timeval*

Callers 5

create_client_timersFunction · 0.85
create_client_omit_timerFunction · 0.85
mainFunction · 0.85
create_server_timersFunction · 0.85
create_server_omit_timerFunction · 0.85

Calls 3

getnowFunction · 0.85
iperf_time_add_usecsFunction · 0.85
list_addFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…