PiImageStreamer
Loading...
Searching...
No Matches
time_util.h File Reference
#include <sys/time.h>
Include dependency graph for time_util.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int current_timestamp ()
 
double calculateDelta (struct timeval start, struct timeval end)
 

Detailed Description

Author
Walter Schilling (schil.nosp@m.ling.nosp@m.@msoe.nosp@m..edu)
Version
1.0

LICENSE

This code is developed as part of the MSOE SWE4211 Real Time Systems course, but can be freely used by others.

SWE4211 Real Time Systems is a required course for students studying the discipline of software engineering.

This Software is provided under the License on an "AS IS" basis and without warranties of any kind concerning the Software, including without limitation merchantability, fitness for a particular purpose, absence of defects or errors, accuracy, and non-infringement of intellectual property rights other than copyright. This disclaimer of warranty is an essential part of the License and a condition for the grant of any rights to this Software.

DESCRIPTION

This is a set of time utilities. It is used for basic timestamping.

Function Documentation

◆ calculateDelta()

double calculateDelta ( struct timeval  start,
struct timeval  end 
)

This method will calculate the time delta between two timestamps.

Parameters
startThis is the starting time.
endThis is the ending time.
Returns
The return will be the delta time between these, in ms.

◆ current_timestamp()

int current_timestamp ( )

This method will return a current timestamp, in ms since the start of the Epoch. Note that the value is truncated to an int, which cannot hold the full count of ms since the Epoch, so only differences between nearby timestamps are meaningful.

Returns
The return will be a timestamp with accuracy to the nearest ms.

This method will return a current timestamp, in ms since the start of the Epoch, truncated to an int.

Returns
The return will be a timestamp with accuracy to the nearest ms.
Here is the caller graph for this function: