Category:EmbeddedLinux - Time Sample

From Digi Developer

Jump to: navigation, search


Time Program for EmbeddedLinux

EmbeddedLinux Time Sample (For Digi EmbeddedLinux 5.x modules) This example Demonstrates how to get time with the Digi EmbeddedLinux modules.

Test Files

This sample program contains one file. The main function is in main.c.

EmbeddedLinux Time Program Test Sample Application

The EmbeddedLinux Time Test sample application can be found here:

Basic Usage

Compile, load and run application.

Sample of main.c file:

 * main.c
 *  Created on: Jan 9, 2012
 *      Author: athomas
#include <stdio.h>
#include <time.h>
#include <unistd.h>
#include <sys/time.h>
int main()
	struct timeval tv;
		if(gettimeofday(&tv,NULL) != 0)
			perror("Gettime Error\n");
		printf("gettimeofday() Seconds : %ld , Microseconds : %ld\n",tv.tv_sec,tv.tv_usec);
	return 0;

This category currently contains no pages or media.

Personal tools
Wiki Editing