_time.pyi 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. from PikaObj import *
  2. def __init__(self): ...
  3. def sleep(self, s: float):
  4. """Sleep for s seconds."""
  5. @PIKA_C_MACRO_IF("PIKA_STD_DEVICE_UNIX_TIME_ENABLE")
  6. def time(self) -> float:
  7. """Get the current time."""
  8. @PIKA_C_MACRO_IF("PIKA_STD_DEVICE_UNIX_TIME_ENABLE")
  9. def time_ns(self) -> int:
  10. """Get the current time in nanoseconds."""
  11. @PIKA_C_MACRO_IF("PIKA_STD_DEVICE_UNIX_TIME_ENABLE")
  12. def gmtime(self, unix_time: float):
  13. """Convert unix time to struct_time."""
  14. @PIKA_C_MACRO_IF("PIKA_STD_DEVICE_UNIX_TIME_ENABLE")
  15. def localtime(self, unix_time: float):
  16. """Convert unix time to struct_time."""
  17. @PIKA_C_MACRO_IF("PIKA_STD_DEVICE_UNIX_TIME_ENABLE")
  18. def mktime(self) -> int:
  19. """Convert struct_time to unix time."""
  20. @PIKA_C_MACRO_IF("PIKA_STD_DEVICE_UNIX_TIME_ENABLE")
  21. def asctime(self):
  22. """Convert struct_time to string."""
  23. @PIKA_C_MACRO_IF("PIKA_STD_DEVICE_UNIX_TIME_ENABLE")
  24. def ctime(self, unix_time: float):
  25. """Convert unix time to string."""
  26. @abstractmethod
  27. def sleep_s(self, s: int): ...
  28. @abstractmethod
  29. def sleep_ms(self, ms: int): ...
  30. @abstractmethod
  31. @PIKA_C_MACRO_IF("PIKA_STD_DEVICE_UNIX_TIME_ENABLE")
  32. def platformGetTick(): ...