This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

有没有可以返回系统当前时间的函数?



多线程抢占,我想要记录代码分支的运行次序,有没有什么函数可以返回系统时间的,就是几点几分这种的

  • 每个core只有一个TSC进行cycle计数,对于单核而言可以都该寄存器来反映各个函数及线程的执行顺序;对于多核而言,由于每个core的TSC是独立的,所以要严格多核同步才可行,对于多核而言或者可以尝试使用GE中的timestamp功能。