Ticket #450: other_workaround.c
File other_workaround.c, 392 bytes (added by , 17 years ago) |
---|
Line | |
---|---|
1 | //returns true every five seconds |
2 | time_t last_checkpoint = 0; |
3 | int fake_time_to_checkpoint() { |
4 | if (last_checkpoint < time() + 5) { |
5 | last_checkpoint = time(); |
6 | return true; |
7 | } |
8 | return false; |
9 | } |
10 | |
11 | int should_checkpoint() { |
12 | if (boinc_is_standalone()) { |
13 | return fake_time_to_checkpoint(); |
14 | } else { |
15 | return boinc_time_to_checkpoint(); |
16 | } |
17 | } |