[pascal] 시간측정

spring·2020년 11월 9일
0
uses SysUtils,DateUtils;
var
	D1,D2:TDateTime;
begin
	D1:=Now;
    {Do Something...}
    D2:=Now;
    writeln(FormatFloat('##0.000',MilliSecondsBetween(D1,D2)/1000));
    {어차피 MilliSecond 이기 때문에 소수점 3자리로 출력한다.}
end.

http://www.freepascal.org/docs-html/rtl/dateutils/millisecondsbetween.html

위 링크에서 년,월,주,일,시,분,초 등 여러가지 시간 비교함수들이 나와있다.

주로쓰는 프로그래밍의 시간측정법을 올린다.

profile
Researcher & Developer @ NAVER Corp | Designer @ HONGIK Univ.

0개의 댓글