Ticket #450: other_workaround.c

File other_workaround.c, 392 bytes (added by Nicolas, 17 years ago)

Another workaround: if standalone, call a different function

Line 
1//returns true every five seconds
2time_t last_checkpoint = 0;
3int fake_time_to_checkpoint() {
4    if (last_checkpoint < time() + 5) {
5        last_checkpoint = time();
6        return true;
7    }
8    return false;
9}
10
11int should_checkpoint() {
12    if (boinc_is_standalone()) {
13                return fake_time_to_checkpoint();
14    } else {
15        return boinc_time_to_checkpoint();
16    }
17}