getting time independent of system time in SUN SOLARIES


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: getting time independent of system time in SUN SOLARIES

  1. #1
    Join Date
    May 2009
    Posts
    4

    getting time independent of system time in SUN SOLARIES

    i am using function
    gethrtime() in sun solaries
    to get the time independent of the system time.Problem with this function is if we restart the system time will change to '0'.is there any other way to resolve this problem.

    thanks & regards
    suresh

  2. #2
    Join Date
    Oct 2007
    Posts
    369
    What do you mean, "independent of the system time"?
    Perhaps you are looking for the POSIX calls for gettimeofday, or timer_gettime.

  3. #3
    Join Date
    Nov 2003
    Posts
    4,118
    gethrtime() is reset whenever the system is rebooted. You should probably use gettimeofday() as jonnin suggested. See also: http://www.devx.com/cplus/Article/35375/0
    Danny Kalev

  4. #4
    Join Date
    Dec 2003
    Posts
    3,366
    If you run across any of my old posts, the time stamp register is not safe on newer computers, at least the assembly I used to have does not work anymore. The cores on multi core processors do not match on the TSC and it seems to be unreliable in other ways now too, so don't go there!

Similar Threads

  1. Change System Time
    By Mike in forum .NET
    Replies: 1
    Last Post: 03-29-2002, 10:10 PM
  2. How to add System time.
    By Pmalik in forum .NET
    Replies: 1
    Last Post: 01-16-2001, 02:54 PM
  3. Replies: 0
    Last Post: 12-05-2000, 08:19 AM
  4. Current System Time?
    By Oscar in forum .NET
    Replies: 6
    Last Post: 08-15-2000, 05:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center