Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: I want micro second it's right
"±èÅÂÈÆ" <kimselect@hotmail.com> wrote in message
news:clqd28$5a7$1@news1.kornet.net...
/* it  is  correct  or  not correct.  this is sample program   */
/* I want  to  get 1/1000 micro second */
/* I was  testing  and  how to method serch */
/* This is borland turbo c++ 3.0   library referance */
/* gcc  */


#include <stdio.h>
#include <sys/timeb.h>
#include <time.h>
main()
{

int  c;

time_t timer;
struct timeb *mil;



while((c = getchar()) == '\n')
{

timer = time(NULL);

ftime(&mil);
printf(" %ld micro    " , mil->millitm   );

printf("[%c]\n",c);

}
getchar();

}





Report this thread to moderator Post Follow-up to this message
Old Post
±èÅÂÈÆ
10-28-04 01:57 PM


Re: I want micro second it's right
* "±èÅÂÈÆ" <kimselect@hotmail.com>
|   struct timeb *mil;

=> struct timeb mil;

|   printf(" %ld micro    " , mil->millitm   );

=> mil.millitm

suse9.1% man ftime
This function is obsolete. Don't use it. If the time in seconds
suffices, time(2) can be used; gettimeofday(2) gives
microseconds; clock_gettime(3) gives nanoseconds but is not yet
widely available.

HTH
R'

Report this thread to moderator Post Follow-up to this message
Old Post
Ralf Fassel
10-28-04 08:59 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Unix Programming archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:06 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.