1637a51d9d27404e9c515da67bbdee2db5a32ae5
[apps/core/preloaded/calendar.git] / common / common.c
1 /*
2
3 Copyright (c) 2000-2012 Samsung Electronics Co., Ltd All Rights Reserved
4
5 This file is part of org.tizen.efl-calendar
6 Written by Taeho Kang <taeho84.kang@samsung.com>
7
8 PROPRIETARY/CONFIDENTIAL
9
10 This software is the confidential and proprietary information of
11 SAMSUNG ELECTRONICS ("Confidential Information"). You shall not
12 disclose such Confidential Information and shall use it only in
13 accordance with the terms of the license agreement you entered
14 into with SAMSUNG ELECTRONICS.
15
16 SAMSUNG make no representations or warranties about the suitability
17 of the software, either express or implied, including but not limited
18 to the implied warranties of merchantability, fitness for a particular
19 purpose, or non-infringement. SAMSUNG shall not be liable for any
20 damages suffered by licensee as a result of using, modifying or
21 distributing this software or its derivatives.
22
23 */
24
25 #include "cld.h"
26
27 #ifdef CAL_TIMECHECK
28 double cal_set_start_time(void)
29 {
30         struct timeval tv;
31         double curtime;
32
33         gettimeofday(&tv, NULL);
34         curtime = tv.tv_sec * 1000 + (double)tv.tv_usec/1000;
35         return curtime;
36 }
37
38 double cal_exec_time(double start, double correction)
39 {
40         double end = cal_set_start_time();
41         return (end - start - correction);
42 }
43
44 double cal_init_time(double correction)
45 {
46         double temp_t;
47         temp_t = cal_set_start_time();
48         return cal_exec_time(temp_t, correction);
49 }
50 #endif//CAL_TIMECHECK