HP-UX
1752785 회원
6131 온라인
108789 솔루션
새 메시지

system 에서 milisecond 까지 확인하기?

 
김태경
조언자

system 에서 milisecond 까지 확인하기?

system에서 milisecond까지 확인 할 수 있는 명령이나

방법이 있는지 알고 싶습니다.



수고 하세요.
3 응답 3
Jongmin, Lee
유치원

system 에서 milisecond 까지 확인하기?

안녕하세요~

이종민입니다.



헛!! 기발한 질문입니다.

저도 궁금한데요...??

혹시 서버를 스톱워치의 용도로 사용하실 계획이신지...??^^



답변도 아니면도 굴비단점 용서하십쑈..
Joseph
초등학생

system 에서 milisecond 까지 확인하기?

아래 ITRC 발췌내용을 참고하세요...



결론적으로 명령어는 제공되지 않으며 gettimeofday() 함수를 이용해서

msec까지 나타낼 수 있습니다..



Have a good day~~



-hp itrc내용-

Sorry that's not available from a "standard" command. You'll have to use the gettimeofday() function.

See man gettimeofday for further details.



고광태
중학생

system 에서 milisecond 까지 확인하기?

아래의 c 프로그램을 사용하면 될것 같은데요..



ftime() 이라는 함수가 있습니다. 이함수가 millisecond 까지



가지고 있는것 같습니다.



#include sys/timeb.h ==> 여기 <> 이 필요합니다.

main()

{

struct timeb mytime;

ftime(&mytime);

printf ("millisecond is %d\n", mytime.millitm);

}



그리고 perl 로 하는 방법도 있네요..



#!/usr/bin/perl -w



my $seconds = time();

printf ("Epoch Seconds = %d\n",$seconds);

my($sec,$min,$hour,$mon,$year,$wday,$yday,$isdst) = localtime($seconds);



$year += 1900;

$mon += 1;



printf("Sec: %d Min: %d Hr: %d Month: %d\n",

$sec,$min,$hour,$mon);

printf("Yr: %d Wk Day: %d Yr Day: %d Is Dst? %d\n",

$year,$wday,$yday,$isdst);

참고하시길..