source: rtems/c/src/tests/itrontests/itrontime01/init.c @ 442d0478

4.104.114.84.95
Last change on this file since 442d0478 was 442d0478, checked in by Joel Sherrill <joel.sherrill@…>, on 11/10/99 at 14:19:55

Combination of committing some new files which had been overlooked
and adding code which installed screens for itron tests.

  • Property mode set to 100644
File size: 1.3 KB
Line 
1/*  Init
2 *
3 *  This routine is the initialization task for this test program.
4 *  It is called from init_exec and has the responsibility for creating
5 *  and starting the tasks that make up the test.  If the time of day
6 *  clock is required for the test, it should also be set to a known
7 *  value by this function.
8 *
9 *  Input parameters:  NONE
10 *
11 *  Output parameters:  NONE
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.OARcorp.com/rtems/license.html.
16 *
17 *  $Id$
18 */
19
20#define TEST_INIT
21#include "system.h"
22#include <stdio.h>
23#include <time.h>
24
25/*
26 * get the current time in second since epoch (1970), change it since 1985,
27 * compute the time in millisecond
28 *
29 */
30 
31int time_sec_epoch( void ) {
32
33int s_time,t_time,r_time;
34long m_sec;
35
36t_time = time(NULL);
37s_time = (1985-1970)*365*24*60*60;
38r_time = t_time - s_time;
39m_sec = r_time*1000;
40
41printf( "Time from 1970: %d\n", t_time );
42printf( "Time between 1970 and 1985: %d\n", s_time );
43printf( "Time from 1985: %d\n", r_time );
44printf("milliseconds: %f\n",m_sec);
45
46return 0;
47}
48
49
50
51void ITRON_Init( void )
52{
53  printf( "\n\n*** ITRON TIME TEST 01 ***\n" );
54  printf( "doesn't test anything yet\n" );
55  printf( "*** END OF ITRON TIME TEST 01 ***\n" );
56  exit( 0 );
57}
58
59
Note: See TracBrowser for help on using the repository browser.