显示毫秒级的时间

From:MSDN

#include <stdio.h>
#include <sys/timeb.h>
#include <time.h>

void main( void )
{
  struct _timeb timebuffer;
  char *timeline;

  _ftime( &timebuffer );
  timeline = ctime( & ( timebuffer.time ) );

  printf( "The time is %.19s.%hu %s", timeline, timebuffer.millitm, &timeline[20] );
}

Output

The time is Tue Mar 21 15:26:41.341 1995

你可能感兴趣的:(时间)