_time.pyi 1.3 KB

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