repo.or.cz
/
chuck-blob.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
*** empty log message ***
[chuck-blob.git]
/
v2
/
examples
/
time
/
time_operations.ck
blob
4398a886599de01c67bfb4ea7f23f2a6b58b8198
1
// ...
2
3
// store the current time
4
now => time t1;
5
6
//value to duration
7
0.5::second => dur d;
8
<<<"one">>>;
9
//now waits for that duration
10
d => now;
11
<<<"two">>>;
12
13
//define new duration
14
d * 4.0 => dur four_d;
15
16
//wait again.
17
four_d => now;
18
<<<"three">>>;
19
20
now => time t2;
21
22
t2 - t1 => dur span;
23
<<<"total">>>;
24
<<<span>>>;
25
<<<"relative">>>;
26
<<<span / d>>>;
27