MCPcopy Create free account
hub / github.com/F-Stack/f-stack / us_to_time

Function us_to_time

tools/ipfw/dummynet.c:169–182  ·  view source on GitHub ↗

integer to time */

Source from the content-addressed store, hash-verified

167
168/* integer to time */
169static void
170us_to_time(int t, char *strt)
171{
172 if (t < 0)
173 strt[0]='\0';
174 else if ( t==0 )
175 sprintf(strt,"%d", t);
176 else if (t< 1000)
177 sprintf(strt,"%dus", t);
178 else if (t < 1000000)
179 sprintf(strt,"%gms", (float) t / 1000);
180 else
181 sprintf(strt,"%gfs", (float) t / 1000000);
182}
183
184/*
185 * returns -1 if s is not a valid time, otherwise, return time in us

Callers 1

get_extra_parmsFunction · 0.85

Calls 1

sprintfFunction · 0.85

Tested by

no test coverage detected