Class WasiTimeOperations

java.lang.Object
ai.tegmentum.wasmtime4j.wasi.AbstractWasiTimeOperations
ai.tegmentum.wasmtime4j.panama.wasi.WasiTimeOperations

public final class WasiTimeOperations extends ai.tegmentum.wasmtime4j.wasi.AbstractWasiTimeOperations
Panama FFI implementation of WASI time and clock operations.

Provides access to WASI time operations using Panama Foreign Function Interface. Constants, convenience methods, and static utilities are inherited from AbstractWasiTimeOperations.

Since:
1.0.0
  • Field Summary

    Fields inherited from class ai.tegmentum.wasmtime4j.wasi.AbstractWasiTimeOperations

    MAX_CLOCK_ID, WASI_CLOCK_MONOTONIC, WASI_CLOCK_PROCESS_CPUTIME_ID, WASI_CLOCK_REALTIME, WASI_CLOCK_THREAD_CPUTIME_ID
  • Constructor Summary

    Constructors
    Constructor
    Description
    WasiTimeOperations(WasiContext wasiContext, SymbolLookup symbolLookup)
    Creates a new WASI time operations instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    getClockResolution(int clockId)
     
    long
    getCurrentTime(int clockId, long precision)
     

    Methods inherited from class ai.tegmentum.wasmtime4j.wasi.AbstractWasiTimeOperations

    convertTime, getClockName, getCurrentTime, getMonotonicTime, getProcessCpuTime, getRealtime, getThreadCpuTime, isClockSupported, validateClockId

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • WasiTimeOperations

      public WasiTimeOperations(WasiContext wasiContext, SymbolLookup symbolLookup) throws PanamaException
      Creates a new WASI time operations instance.
      Parameters:
      wasiContext - the WASI context to operate within
      symbolLookup - the symbol lookup for native WASI functions
      Throws:
      PanamaException - if the wasiContext or symbolLookup is null, or if native function lookup fails
  • Method Details

    • getClockResolution

      public long getClockResolution(int clockId) throws ai.tegmentum.wasmtime4j.exception.WasiException
      Specified by:
      getClockResolution in class ai.tegmentum.wasmtime4j.wasi.AbstractWasiTimeOperations
      Throws:
      ai.tegmentum.wasmtime4j.exception.WasiException
    • getCurrentTime

      public long getCurrentTime(int clockId, long precision) throws ai.tegmentum.wasmtime4j.exception.WasiException
      Specified by:
      getCurrentTime in class ai.tegmentum.wasmtime4j.wasi.AbstractWasiTimeOperations
      Throws:
      ai.tegmentum.wasmtime4j.exception.WasiException