utime

来自「EPIC IRC客户端。来源于IRCII客户端但做了很多性能和功能的优化。」· 代码 · 共 54 行

TXT
54
字号
## Here's the plan# Kanan wants a way to manipulate $utime() values.  Because theyre # thrown about as two words, we cant actually have the math parser# handle them automatically (alas), and writing built in functions# just to do this seems like overkill.  So i wrote these aliases for# his (and your) convenience.  Use this is as a starting point for you# own alias needs, or drop me a line if you have more suggestions.# (jnelson@acronet.net)### Add two utimes.#alias utime_add {	local sec,usec	@ sec = [$0] + [$2]	@ usec = [$1] + [$3]	if (usec > 1000000)	{		@ usec -= 1000000, sec++	}	@ function_return = sec ## [ ] ## right(6 000000$usec)}## Subtract two utimes.  The LARGER utime (the more recent) should# be the first one specified#alias utime_sub{	local sec,usec	@ sec = [$0] - [$2]	@ usec = [$1] - [$3]	if (usec < 0)	{		@ usec += 1000000, sec--	}	@ function_return = sec ## [ ] ## right(6 000000$usec)}## You pass a utime as $0, $1, and this function will return# how many useconds have passed since then.#alias time_since{	local now $utime()	@ function_return = utime_sub($now $0 $1)}#hop'97

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?