| 1 |
AgentTime |
| 2 |
================ |
| 3 |
|
| 4 |
## Overview |
| 5 |
|
| 6 |
AgentTime exports platform independent time related functions. It is a platform abstraction and it requires a specific implementation for each platform. |
| 7 |
Most of the times these functions can simply call the C standard time functions. |
| 8 |
|
| 9 |
Most implementations of the C `time()` function return seconds since 00:00 hours, Jan 1, 1970 UTC. Implementations |
| 10 |
which do not must convert the output of `time()` to conform to this spec. |
| 11 |
|
| 12 |
###### Header files |
| 13 |
- [agenttime.h](https://github.com/Azure/azure-c-shared-utility/blob/master/inc/azure_c_shared_utility/agenttime.h)<br/> |
| 14 |
|
| 15 |
|
| 16 |
## Exposed API |
| 17 |
**SRS_AGENT_TIME_99_001: [** AGENT_TIME shall have the following interface **]** |
| 18 |
```c |
| 19 |
/* same functionality as most implementations time() of standard C function */ |
| 20 |
time_t get_time(time_t* p); |
| 21 |
|
| 22 |
/*the same as C's difftime*/ |
| 23 |
extern double get_difftime(time_t stopTime, time_t startTime); |
| 24 |
``` |
| 25 |
|
| 26 |
**SRS_AGENT_TIME_30_002: [** The `time_t` values in this interface shall be seconds since 00:00 hours, Jan 1, 1970 UTC. **]** |
| 27 |
|
| 28 |
**SRS_AGENT_TIME_30_003: [** The `get_gmtime`, `get_mktime`, and `get_ctime` functions in are deprecated and shall not be used. **]** |