MCPcopy Create free account
hub / github.com/coreboot/coreboot / time

Function time

payloads/libpayload/libc/time.c:132–147  ·  view source on GitHub ↗

* Return the current time expressed as seconds from 00:00:00 UTC, 1 Jan 1970. * * @param tp When not NULL, set this to the current time in seconds. * @return The current time in seconds. */

Source from the content-addressed store, hash-verified

130 * @return The current time in seconds.
131 */
132time_t time(time_t *tp)
133{
134 /*
135 * Call the gtod init when we need it - this keeps the code from
136 * being included in the binary if we don't need it.
137 */
138 if (!clock.ticks)
139 gettimeofday_init();
140
141 update_clock();
142
143 if (tp)
144 *tp = clock.secs;
145
146 return clock.secs;
147}
148
149/**
150 * Return the current time broken into a timeval structure.

Callers 10

gettimeofdayFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
idleFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
PDC_debugFunction · 0.85
eventlog_init_eventFunction · 0.85
init_manifest_headerFunction · 0.85

Calls 2

gettimeofday_initFunction · 0.85
update_clockFunction · 0.85

Tested by 1

mainFunction · 0.68