Mercurial > hg > Members > Moririn
view src/parallel_execution/time.cbc @ 326:f23f6d0aa4e9 examples_directory
Add examples/calc.cbc and build but not work
author | Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 18 Apr 2017 01:47:42 +0900 |
parents | 23767f714f4a |
children |
line wrap: on
line source
#include <stdio.h> #include <sys/time.h> #include "../context.h" __code start_time(struct Time* time) { struct timeval tv; gettimeofday(&tv, NULL); time->time = tv.tv_sec + (double)tv.tv_usec*1e-6; goto meta(context, time->next); } __code start_time_stub(struct Context* context) { goto start_time(context, &context->data[D_Time]->Time); } __code end_time(struct Time* time) { struct timeval tv; gettimeofday(&tv, NULL); printf("%0.6f\n", (tv.tv_sec+(double)tv.tv_usec*1e-6) - time->time); goto meta(context, time->next); } __code end_time_stub(struct Context* context) { goto end_time(context, Gearef(context, Time)); }