cyg_clock_create
Name: cyg_clock_create ( ) - create a clock
Synopsis:
void cyg_clock_create
(
  cyg_resolution_t resolution, /* resolution     */
  cyg_handle_t     *handle,    /* created handle */
  cyg_clock        *clock      /* clock object   */
)
Description: This creates a new clock with a given resolution. A clock is nothing more than a counter with an associated resolution. It is assumed that the underlying counter of any clock has a source of regular ticks. A clock can be converted to a counter, but a counter cannot necessarily be converted to a clock.

This function does not return the newly created clock directly, it returns it through a pointer to "handle".

Include: #include <cyg/kernel/kapi.h>
Returns: nothing
See Also: cyg_clock_delete

cyg_clock_delete
Name: cyg_clock_delete ( ) - delete a clock
Synopsis:
void cyg_clock_delete
(
  cyg_handle_t clock /* clock to delete */
)
Description: This deletes a clock. Be sure that no other parts of the system are using the clock when you call this function.
Include: #include <cyg/kernel/kapi.h>
Returns: nothing
See Also: cyg_clock_delete

cyg_clock_to_counter
Name: cyg_clock_to_counter ( ) - converts a clock to a counter
Synopsis:
void cyg_clock_to_counter
(
  cyg_handle_t clock,   /* clock to convert          */
  cyg_handle_t *counter /* address of counter object */
)
Description: This converts a clock to a counter. A clock is nothing more than a counter with an associated resolution. The counter is not returned directly but through a pointer.
Include: #include <cyg/kernel/kapi.h>
Returns: nothing
See Also: cyg_real_time_clock, cyg_current_time

cyg_clock_set_resolution
Name: cyg_clock_set_resolution ( ) - set clock resolution
Synopsis:
void cyg_clock_set_resolution
(
  cyg_handle_t     clock,     /* clock                       */
  cyg_resolution_t resolution /* new resolution to set clock */
)
Description: This sets the resolution of the given clock. The resolution is described as struct {cyg_uint32 dividend; cyg_uint32 divisor;}.
Include: #include <cyg/kernel/kapi.h>
Returns: nothing
See Also: cyg_clock_get_resolution, cyg_current_time

cyg_clock_get_resolution
Name: cyg_clock_get_resolution ( ) - get resolution of a clock
Synopsis:
cyg_resolution_t cyg_clock_get_resolution
(
  cyg_handle_t clock /* clock to get resolution of */
)
Description: This gets the resolution of the given clock. The resolution is described as struct {cyg_uint32 dividend; cyg_uint32 divisor;}.
Include: #include <cyg/kernel/kapi.h>
Returns: the resolution of the specified clock.
See Also: cyg_clock_set_resolution, cyg_current_time

cyg_real_time_clock
Name: cyg_real_time_clock ( ) - get the real time system clock
Synopsis:
cyg_handle_t cyg_real_time_clock
(
  void
)
Description: This gets the system's real time clock. The real time clock is used for system delays, blocking waits, etc.
Include: #include <cyg/kernel/kapi.h>
Returns: the system's real time clock.
See Also: cyg_clock_set_resolution, cyg_clock_get_resolution, cyg_current_time

cyg_current_time
Name: cyg_current_time ( ) - get the current system time
Synopsis:
cyg_tick_count_t cyg_current_time
(
  void
)
Description: This gets the current system time in ticks. The system time is represented as a 64 bit number. Since the system time is a 64 bit number, there is no danger of overflow since a tick every 1ns would not roll over for over 500 years.
Include: #include <cyg/kernel/kapi.h>
Returns: the current system time.
See Also: cyg_clock_set_resolution, cyg_clock_get_resolution, cyg_real_time_clock