Clock tick

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Feb 2007
Posts: 50
Reputation: volscolts16 is an unknown quantity at this point 
Solved Threads: 0
volscolts16's Avatar
volscolts16 volscolts16 is offline Offline
Junior Poster in Training

Clock tick

 
0
  #1
Nov 9th, 2008
What is a clock tick equal to in ctime??
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 670
Reputation: Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough 
Solved Threads: 113
Freaky_Chris's Avatar
Freaky_Chris Freaky_Chris is offline Offline
Practically a Master Poster

Re: Clock tick

 
0
  #2
Nov 9th, 2008
Im guessing you mean in relation to realy time, you may want to use CLOCKS_PER_SEC to get things in terms of time and in terms of time to clocks for example divide clock()/CLOCKS_PER_SEC withh give you how many seconds, etc and if you want to wait for x seconds do seconds*CLOCKS_PER_SEC

Chris
Knowledge is power -- But experience is everything
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 2,001
Reputation: ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of 
Solved Threads: 343
ArkM's Avatar
ArkM ArkM is offline Offline
Postaholic

Re: Clock tick

 
0
  #3
Nov 9th, 2008
Originally Posted by volscolts16 View Post
What is a clock tick equal to in ctime??
The time_t type is an implementation-defined arithmetic type capable of representing times. Use difftime function to get the difference between two times of type time_t in seconds as a double value:
  1. #include <time.h>
  2. ...
  3. time_t t;
  4. time(&t);
  5. printf("time_t step %f sec\n",difftime(t+1,t)); // time_t precision
As usually, it's equal to 1 sec (but it's not the language standard requirement).
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC