Timer initialized in boinc_init instead of by application.

svn path=/trunk/boinc/; revision=129
This commit is contained in:
Michael Gary 2002-06-24 01:58:21 +00:00
parent 07c83375dc
commit 157187bfbd
2 changed files with 5 additions and 1 deletions

View File

@ -103,12 +103,14 @@ void write_core_file(FILE* f, APP_IN& ai) {
"<graphics_refresh_period>%f</graphics_refresh_period>\n"
"<checkpoint_period>%f</checkpoint_period>\n"
"<poll_period>%f</poll_period>\n"
"<checkpoint_period>%f</checkpoint_period>\n"
"<cpu_time>%f</cpu_time>\n",
ai.graphics.xsize,
ai.graphics.ysize,
ai.graphics.refresh_period,
ai.checkpoint_period,
ai.poll_period,
ai.checkpoint_period,
ai.cpu_time
);
}
@ -130,6 +132,7 @@ void parse_core_file(FILE* f, APP_IN& ai) {
else if (parse_double(buf, "<graphics_refresh_period>", ai.graphics.refresh_period)) continue;
else if (parse_double(buf, "<checkpoint_period>", ai.checkpoint_period)) continue;
else if (parse_double(buf, "<poll_period>", ai.poll_period)) continue;
else if (parse_double(buf, "<checkpoint_period>", ai.checkpoint_period)) continue;
else if (parse_double(buf, "<cpu_time>", ai.cpu_time)) continue;
else fprintf(stderr, "parse_core_file: unrecognized %s", buf);
}

View File

@ -25,10 +25,11 @@ int main() {
MFILE mf;
unsigned long int i = 0;
int temp=0;
APP_IN ai;
boinc_init(ai);
mf.open("foobar", "w");
mf.printf("blah %d %f\n", 17, 34.5);
mf.printf("foo\n");
set_timer(1);
for(; i<100000000; i++) {
if(time_to_checkpoint()) {
mf.printf("checkpoint: %ld\n", i);