2024-06-25 05:31:25 发布
网友
我有一个Python代码,我想用nvprof或visual profiler来评测, 我想知道我的代码使用了多少线程?在
nvprof
visual profiler
我需要Linux命令。在
使用此命令:
sudo dmidecode -t 4 | egrep -i "Designation|Intel|core|thread"
给我这个信息,但不是我的代码:
我想知道我的Python代码使用了多少线程。在
{a1}你可以使用。根据文件:
Return the number of Thread objects currently alive. The returned count is equal to the length of the list returned by enumerate().
Thread
enumerate()
根据^{}的文档:
Return a list of all Thread objects currently alive. The list includes daemonic threads, dummy thread objects created by current_thread(), and the main thread. It excludes terminated threads and threads that have not yet been started.
current_thread()
{a1}你可以使用。根据文件:
根据^{} 的文档:
相关问题 更多 >
编程相关推荐