2010-05-31 20:14:26 -04:00
|
|
|
! Copyright (C) 2008, 2010 Slava Pestov
|
2008-01-28 19:13:35 -05:00
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
2008-02-18 10:08:59 -05:00
|
|
|
USING: calendar namespaces models threads kernel init ;
|
2008-01-28 19:13:35 -05:00
|
|
|
IN: calendar.model
|
|
|
|
|
|
|
|
SYMBOL: time
|
|
|
|
|
|
|
|
: (time-thread) ( -- )
|
|
|
|
now time get set-model
|
2008-11-19 02:50:05 -05:00
|
|
|
1 seconds sleep (time-thread) ;
|
2008-01-28 19:13:35 -05:00
|
|
|
|
2008-02-18 06:07:40 -05:00
|
|
|
: time-thread ( -- )
|
2008-06-11 21:27:31 -04:00
|
|
|
[
|
|
|
|
init-namespaces
|
|
|
|
(time-thread)
|
|
|
|
] "Time model update" spawn drop ;
|
2008-01-28 19:13:35 -05:00
|
|
|
|
2010-05-31 20:14:26 -04:00
|
|
|
[
|
|
|
|
f <model> time set-global
|
|
|
|
time-thread
|
|
|
|
] "calendar.model" add-startup-hook
|