_time.pyi 1.1 KB

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