S12X - Time clock

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

S12X - Time clock

1,884 次查看
candriver
Contributor I
Hi...
 
In xgate can driver code..i am using this code:
 
#include<time.h>
clock_t start,end;
start=clock();
  
 Int_Init();        /* my function name */  
 
 end=clock()-start;  
now i want to know abt what s the value stored in this end variable.....means can i see the value of this variable......how i can print this variable.
Thanks
 
Alban Edit: part name in subject line

Message Edited by Alban on 2007-03-28 08:36 AM

标签 (1)
0 项奖励
回复
2 回复数

532 次查看
Alban
Senior Contributor II
Hello,
 
Please mention device name in the subject line in all your messages.
 
You can see the variable if it is stored in a memory area visible by both cores. XGATE - CPU shared area is a good idea to authorize modification by both cores.
 
Alban.
0 项奖励
回复

532 次查看
PsychoDebugger
Contributor I
I didn't know that is possible to use this function in embedded system i read, from codewarrior help:

Time Functions

In the ANSI library, there also are several function to get the current time. In an embedded systems environment, implementations for these functions cannot be provided because different targets may use different ways to count the time

Listing 14.14 ANSI-C time functions

clock_t   clock(void);
time_t    time(time_t *time_val);
struct tm * localtime(const time_t *time_val);
time_t    mktime(struct tm *time_rec);
char      * asctime(const struct tm *time_rec);
char      ctime(const time *time_val);
size_t    strftime(char *s, size_t n,
                   const char *format,
                   const struct tm *time_rec);
double    difftime(time_t t1, time_t t2);
struct tm * gmtime(const time_t *time_val);

0 项奖励
回复