4 * Copyright 2012 Samsung Electronics Co., Ltd
6 * Licensed under the Flora License, Version 1.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://floralicense.org/license/
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
23 double cal_set_start_time(void)
28 gettimeofday(&tv, NULL);
29 curtime = tv.tv_sec * 1000 + (double)tv.tv_usec/1000;
33 double cal_exec_time(double start, double correction)
35 double end = cal_set_start_time();
36 return (end - start - correction);
39 double cal_init_time(double correction)
42 temp_t = cal_set_start_time();
43 return cal_exec_time(temp_t, correction);