Project

General

Profile

Actions

機能 #1977

closed

ログの時刻をミリ秒、マイクロ秒まで表示できるようにする

Added by n-ando over 14 years ago. Updated about 12 years ago.

Status:
終了
Priority:
通常
Assignee:
Target version:
-
Start date:
12/31/2010
Due date:
% Done:

100%

Estimated time:

Description

ミリ秒、マイクロ秒表示のために、新たに以下の指定子を導入する。

  • ミリ秒の指定子: %Q
  • マイクロ秒の指定子: %q

さらにデフォルトの時刻表示のフォーマットを

  • %b %d %H:%M:%S.%Q

とすること。

Actions #1

Updated by Anonymous over 14 years ago

  • Status changed from 新規 to 担当

現状 は、"%tb %td %tH:%tM:%tS"。
java.util.Formatter の format() を使用。
マイクロ秒オーダーは検討が必要。

Actions #2

Updated by Anonymous almost 14 years ago

  • % Done changed from 0 to 50

ミリ秒表示の対応は済み。

Actions #3

Updated by ga over 12 years ago

  • Status changed from 担当 to 解決
  • Assignee changed from Anonymous to ga
  • % Done changed from 50 to 100

Javaではシステム時刻の取得は、System.currentTimeMillisを使用してミリ秒単位までは可能です。
また、System.nanoTimeを使用することで、ナノ秒単位の時刻も取得できるのですが、このメソッドは時刻の差分取得用に用意されているため、戻り値が時刻の絶対値とはなっていません。
そこで、上記の2つのメソッドを組み合わせて、擬似的にマイクロ秒単位での表示ができるように修正させて頂きました。
ただし、言語仕様的に正確な時刻はミリ秒単位までしか取得できないため、マイクロ秒の単位については、あくまでも目安となる近似値を出力する形となっています。
r687

Actions #4

Updated by n-ando about 12 years ago

  • Status changed from 解決 to 終了
Actions

Also available in: Atom PDF