gaston feng

驱动程序中的时间计量
gaston feng | May 10, 2008 12:09:31 AM
#include<linux/time.h>

static struct timeval   first_tick;


  do_gettimeofday(&first_tick);


unsigned long set_ev_time(void) {
  struct timeval now;

  do_gettimeofday(&now);
  return (now.tv_sec -first_tick.tv_sec )*1000 +
         (now.tv_usec-first_tick.tv_usec)/1000;
}

用户程序中将do_gettimeofday(&now);替换成gettimeofday(&now,NULL);

Comment: (no reply)
To post your comment, Please login first.