ts-7000
[Top] [All Lists]

[ts-7000] Time printing

To:
Subject: [ts-7000] Time printing
From: "marcolamonato" <>
Date: Tue, 18 Mar 2008 09:16:30 -0000
Hi,

I've got a TS-7250 with RTC installed

1) can I print the machine clock time with the micro-second 
resolution?

2) how?

So far, I've only been able to have a 10-usec resolution, with the 
following C code:

/* Variables */
time_t actual_date;
struct tm *actual_time_tm;
struct timeval tp;
long milli;

/* Time Print */
actual_date = time(NULL);
actual_time_tm = gmtime(&actual_date);
gettimeofday(&tp,(struct timezone *)NULL);
milli=tp.tv_usec/1000;/* For  3 digit resolution */ 
printf("\nTime: %02d:%02d:%02d.%03d\n", actual_time_tm->tm_hour, 
actual_time_tm->tm_min, actual_time_tm->tm_sec, milli);


This prints out something like:
"Time: 09:06:05.770"
"Time: 09:06:05.780"
"Time: 09:06:05.850"


Thanks for your help,
Marco
                 


========================================================================
Groups related to ts-7000                                       
========================================================================

lpc2000 (98 common members)           
http://groups.yahoo.com/group/lpc2000?v=1&t=ipt&ch=email&pub=groups&slk=aftr0&sec=recg
  
Microprocessors/Microcontrollers: The NXP (formerly Philips) LPC2000 family of 
ARM M...

nslu2-general (82 common members)           
http://groups.yahoo.com/group/nslu2-general?v=1&t=ipt&ch=email&pub=groups&slk=aftr1&sec=recg
  
Computers & Internet/Hardware: This is the general support group for the NSLU2 
ma...

msp430 (64 common members)           
http://groups.yahoo.com/group/msp430?v=1&t=ipt&ch=email&pub=groups&slk=aftr2&sec=recg
  
Computers & Internet/Hardware: Welcome to the MSP430 User's Group! The purpose 
of...

motherboardmemorycpu (54 common members)           
http://groups.yahoo.com/group/motherboardmemorycpu?v=1&t=ipt&ch=email&pub=groups&slk=aftr3&sec=recg
  
Computers & Internet/Hardware: The purpose of the group will be to share 
informat...

handyboard (52 common members)           
http://groups.yahoo.com/group/handyboard?v=1&t=ipt&ch=email&pub=groups&slk=aftr4&sec=recg
  
Computers & Internet/Hardware: The Handy Board is a 68HC11-based controller 
board...


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU