S12X - Time clock

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

S12X - Time clock

1,859件の閲覧回数
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 返答(返信)

507件の閲覧回数
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 件の賞賛
返信

507件の閲覧回数
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 件の賞賛
返信