代码拉取完成,页面将自动刷新
Get universal time (in MILLISECONDS) from a variable which is periodically updated by a background thread.
This is used for very intensively time getting with not very high accuracy.
The usage is very simple:
set-soft-time-resolution
, defines the updating resolution, which is default by 0.005 second.initialize-soft-time
, run the background thread to update the time.*time-getter*
to get the result, in milliseconds. Here, *time-getter*
is an function object, which is set to the real soft time getter or hard time getter, according to the time policy.If you only want to get the OS time, just call get-hard-time
without the steps above.
get-universal-time
runs as fast as get-soft-time
, however, get-universal-time
returns time by seconds, while get-soft-time
returns time by milliseconds.
;; simple usage
(set-soft-time-resolution 0.01)
(initialize-soft-time)
(funcall *time-getter*) ; get universal time in milliseconds
;; get an set time policy, can be either :soft or :hard, default :soft
(get-time-policy)
(set-time-policy :hard)
;; time resolution, in seconds, should be greater than 0
(get-soft-time-resolution)
(set-soft-time-resolution 0.1)
(shutdown-soft-time)
(restart-soft-time)
(soft-time-enabled-p) ; if updating thread started
;; get time directly
(get-soft-time)
(get-hard-time)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。