For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > October 2004 > I want micro second









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author I want micro second
±èÅÂÈÆ

2004-10-28, 8:57 am

/* 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;

timer = time(NULL);

ftime(&mil);


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

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

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

}
getchar();

}


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com