我需要获取 Dart 中当前线程的 id。类似于我在 Java(或 C#)中执行此操作的方式:
Thread.currentThread().getId()
Run Code Online (Sandbox Code Playgroud)
你说的是正在运行的程序的进程ID吗?因为这可以通过 dart:io 的 pid 属性实现:
https://api.dartlang.org/stable/2.3.1/dart-io/pid.html
| 归档时间: |
|
| 查看次数: |
2436 次 |
| 最近记录: |