加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
windows_time.pxi 604 Bytes
一键复制 编辑 原始数据 按行查看 历史
Kamen Kirov 提交于 2017-09-25 20:26 . Get timestamp from libuvc
import time
#on windows
from libc.stdint cimport uint64_t, int64_t
cdef extern from "Windows.h":
int QueryPerformanceCounter(int64_t *)
int QueryPerformanceFrequency(int64_t *)
cdef double get_sys_time_monotonic():
cdef int64_t ts
cdef int64_t freq
cdef int64_t t_us
cdef int64_t fullsecs
cdef int64_t us_left
QueryPerformanceCounter(&ts)
QueryPerformanceFrequency(&freq)
t_us = (ts * 1000000 ) / freq
fullsecs = t_us / 1000000
us_left = t_us - fullsecs*1000000
cdef double secs = <double> fullsecs + <double>us_left/1000000.0
return secs
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化