OpenOCD
time_support.c File Reference
Include dependency graph for time_support.c:

Go to the source code of this file.

Functions

float duration_elapsed (const struct duration *duration)
 
float duration_kbps (const struct duration *duration, size_t count)
 
int duration_measure (struct duration *duration)
 Update the duration->elapsed field to finish the duration measurement. More...
 
int duration_start (struct duration *duration)
 Update the duration->start field to start the duration measurement. More...
 
int timeval_add_time (struct timeval *result, long sec, long usec)
 
int timeval_compare (const struct timeval *x, const struct timeval *y)
 
int timeval_subtract (struct timeval *result, struct timeval *x, struct timeval *y)
 

Function Documentation

◆ duration_elapsed()

float duration_elapsed ( const struct duration duration)
Returns
Elapsed time in seconds.

Definition at line 83 of file time_support.c.

References duration::elapsed, timeval::tv_sec, and timeval::tv_usec.

Referenced by COMMAND_HANDLER(), COMMAND_HELPER(), duration_kbps(), and stmqspi_blank_check().

◆ duration_kbps()

float duration_kbps ( const struct duration duration,
size_t  count 
)
Returns
KB/sec for the elapsed duration and count bytes.

Definition at line 90 of file time_support.c.

References count, and duration_elapsed().

Referenced by COMMAND_HANDLER(), COMMAND_HELPER(), and stmqspi_blank_check().

◆ duration_measure()

int duration_measure ( struct duration duration)

Update the duration->elapsed field to finish the duration measurement.

Definition at line 74 of file time_support.c.

References duration::elapsed, gettimeofday(), NULL, duration::start, and timeval_subtract().

Referenced by COMMAND_HANDLER(), COMMAND_HELPER(), nand_fileio_finish(), and stmqspi_blank_check().

◆ duration_start()

int duration_start ( struct duration duration)

Update the duration->start field to start the duration measurement.

Definition at line 69 of file time_support.c.

References gettimeofday(), NULL, and duration::start.

Referenced by COMMAND_HANDLER(), COMMAND_HELPER(), nand_fileio_start(), and stmqspi_blank_check().

◆ timeval_add_time()

int timeval_add_time ( struct timeval result,
long  sec,
long  usec 
)

◆ timeval_compare()

int timeval_compare ( const struct timeval x,
const struct timeval y 
)

◆ timeval_subtract()

int timeval_subtract ( struct timeval result,
struct timeval x,
struct timeval y 
)

Definition at line 21 of file time_support.c.

References timeval::tv_sec, and timeval::tv_usec.

Referenced by COMMAND_HANDLER(), and duration_measure().