SW006013 Microchip Technology, SW006013 Datasheet - Page 144

MPLAB C Compiler For DsPIC DSCs

SW006013

Manufacturer Part Number
SW006013
Description
MPLAB C Compiler For DsPIC DSCs
Manufacturer
Microchip Technology
Series
DsPIC30F/33Fr
Type
MPLAB® C Compilerr
Datasheet

Specifications of SW006013

Supported Families
DsPIC30F, DsPIC33F
Core Architecture
DsPIC
Kit Contents
Software And Docs
Mcu Supported Families
DsPIC30F And DsPIC33F
Tool Function
Compiler
Tool Type
Compiler
Processor Series
dsPIC
Lead Free Status / RoHS Status
na
For Use With/related Products
dSPIC DSCs
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
DS51456E-page 140
difftime
Description:
Include:
Prototype:
Arguments:
Return Value:
Remarks:
Example:
gmtime
Description:
Include:
Prototype:
Argument:
Return Value:
Remarks:
Find the difference between two times.
<time.h>
double difftime(time_t t1, time_t t0);
t1
t0
Returns the number of seconds between t1 and t0.
By default, the 16-bit compiler returns the time as instruction cycles so
difftime returns the number of ticks between t1 and t0.
#include <time.h>
#include <stdio.h> /* for printf
volatile int i;
int main(void)
{
}
Output:
start = 0
stop = 317
Elapsed time = 317
Converts calendar time to time structure expressed as Universal Time
Coordinated (UTC) also known as Greenwich Mean Time (GMT).
<time.h>
struct tm *gmtime(const time_t *tod);
tod
Returns the address of the time structure.
This function breaks down the tod value into the time structure of type
tm. By default, the 16-bit compiler returns the time as instruction
cycles. With this default gmtime and localtime will be equivalent
except gmtime will return tm_isdst (Daylight Savings Time flag) as
zero to indicate that Daylight Savings Time is not in effect.
clock_t start, stop;
double elapsed;
start = clock();
for (i = 0; i < 10; i++)
stop = clock();
printf("start = %ld\n", start);
printf("stop = %ld\n", stop);
elapsed = difftime(stop, start);
printf("Elapsed time = %.0f\n", elapsed);
ending time
beginning time
pointer to stored time
/* for clock, difftime */
© 2008 Microchip Technology Inc.
*/

Related parts for SW006013