Documentation
WASIX
clock_time_set

clock_time_set()

Set the time of the specified clock.

Description

The clock_time_set() function is used to set the time of the specified clock.

Syntax

  ;;; Note: This is similar to `clock_settime` in POSIX.
  ;;; Sets the time value of a clock.
  (@interface func (export "clock_time_set")
    ;;; The clock for which to set the time.
    (param $id $clockid)
    ;;; The value of the time to be set.
    (param $timestamp $timestamp)
    ;;; The time value of the clock.
    (result $error (expected (error $errno)))
  )

Parameters

  • ctx: A mutable reference to the function environment.
  • clock_id: The ID of the clock to query.
  • time: The value of the clock in nanoseconds.

Return Value

The function returns an Errno value indicating the success or failure of the operation.

Logging

This function has been instrumented with trace-level logging. It will log the following information:

  • ?clock_id: The ID of the clock being queried.
  • %time: The value of the clock being set.

Note

The clock_time_set() function sets the time of the specified clock. The provided time value is in nanoseconds.