|
|
|
Вопрос про Timer
|
|||
|---|---|---|---|
|
#18+
Скажите пожалуйста,как мне создаь таймер,который будет запускат каждые сутки в 00 часов и 20 минут определенную задачу,не знаю как реализовать такое через класс Timer. Спасибо ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 14.02.2007, 10:19:45 |
|
||
|
Вопрос про Timer
|
|||
|---|---|---|---|
|
#18+
Кто-то поможет мне? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 14.02.2007, 11:33:52 |
|
||
|
Вопрос про Timer
|
|||
|---|---|---|---|
|
#18+
а обязательно пользоваться средствами явы? такое обычно вешают на какой-нить штатный scheduler, типа cron. а вообще есть Timer.scheduleAtFixedRate(TimerTask task, Date firstTime, long period), как раз то что вам нужно. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 14.02.2007, 12:53:34 |
|
||
|
Вопрос про Timer
|
|||
|---|---|---|---|
|
#18+
Deadyа обязательно пользоваться средствами явы? такое обычно вешают на какой-нить штатный scheduler, типа cron. а вообще есть Timer.scheduleAtFixedRate(TimerTask task, Date firstTime, long period), как раз то что вам нужно. обязательно. а теперь расшифруйте мне пожалуйста параметры метода scheduleAtFixedRate,особенно второй и 3 интересует,про первый все понятно ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 14.02.2007, 17:23:13 |
|
||
|
Вопрос про Timer
|
|||
|---|---|---|---|
|
#18+
JulT обязательно. а теперь расшифруйте мне пожалуйста параметры метода scheduleAtFixedRate,особенно второй и 3 интересует,про первый все понятно во народ. а javadoc для кого пишут? автор Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay. Subsequent executions take place at approximately regular intervals, separated by the specified period. In fixed-rate execution, each execution is scheduled relative to the scheduled execution time of the initial execution. If an execution is delayed for any reason (such as garbage collection or other background activity), two or more executions will occur in rapid succession to "catch up." In the long run, the frequency of execution will be exactly the reciprocal of the specified period (assuming the system clock underlying Object.wait(long) is accurate). Fixed-rate execution is appropriate for recurring activities that are sensitive to absolute time, such as ringing a chime every hour on the hour, or running scheduled maintenance every day at a particular time. It is also appropriate for for recurring activities where the total time to perform a fixed number of executions is important, such as a countdown timer that ticks once every second for ten seconds. Finally, fixed-rate execution is appropriate for scheduling multiple repeating timer tasks that must remain synchronized with respect to one another. Parameters: task - task to be scheduled. delay - delay in milliseconds before task is to be executed. period - time in milliseconds between successive task executions. 2ой - через сколько времени начинать выполнение 3ий - через какой интервал времени повторять ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 14.02.2007, 18:07:14 |
|
||
|
|

start [/forum/topic.php?fid=59&fpage=661&tid=2146644]: |
0ms |
get settings: |
15ms |
get forum list: |
23ms |
check forum access: |
6ms |
check topic access: |
6ms |
track hit: |
37ms |
get topic data: |
10ms |
get forum data: |
2ms |
get page messages: |
59ms |
get tp. blocked users: |
2ms |
| others: | 326ms |
| total: | 486ms |

| 0 / 0 |
