最近在做VoIP方面的驱动,总共有16个FXS口和FXO口依次初始化,耗用的时间较多。准备将其改为多线程,首先需要确定哪个环节消耗的时间多,这就需要获取系统时间。

#include <linux/time.h>  /*头文件*/

struct timeval time_now;
unsigned long int time_num;//获取的时间 do_gettimeofday(&time_now);
time_num = time_now.tv_sec*+time_now.tv_usec/;
time_mark = time_num;
printk("驱动启动-时间=%d\n", time_now);

Linux驱动中获取系统时间的更多相关文章

  1. Linux C 语言 获取系统时间信息

    比如获取当前年份:        /* 获取当前系统时间 暂时不使用        int iyear = 0;        int sysyear = 0;        time_t now;  ...

  2. VC++编程中获取系统时间

    <span style="white-space:pre"> </span>总结了在程序中如何获得系统时间的方法 void CGetSystenTimeDl ...

  3. Java中获取系统时间的四种方式

    第一种: Date day=new Date(); SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss" ...

  4. java总结:Java中获取系统时间(年、月、日)以及下拉菜单默认选择系统年、月、日的方法

    <!-- 获取系统当前的年.月.日 --> <%@ page import="java.util.*"%> <% Calendar calendar= ...

  5. linux中获取系统时间 gettimeofday函数

    linux的man页中对gettimeofday函数的说明中,有这样一个说明:   $ man gettimeofday DESCRIPTION     The functions gettimeof ...

  6. linux中获取系统时间的几种方法

    asctime(将时间和日期以字符串格式表示) 相关函数 time,ctime,gmtime,localtime 表头文件 #include<time.h> 定义函数 char * asc ...

  7. linux下C获取系统时间的方法

    asctime(将时间和日期以字符串格式表示)  相关函数 time,ctime,gmtime,localtime  表头文件 #include  定义函数 char * asctime(const ...

  8. Linux编程(获取系统时间)

    #include <stdio.h> #include <time.h> int main() { time_t now; struct tm *w; time(&no ...

  9. Java 中的系统时间

    currentTimeMillis()System.currentTimeMillis返回的是从1970.1.1 UTC 零点开始到现在的时间,精确到毫秒,平时我们可以根据System.current ...

随机推荐

  1. 安装Discuz开源论坛

    11.添加mysql普通用户 接着上篇的lamp这篇安装Discuz 配置虚拟主机 1.打开虚拟主机配置 [root@NFS-31 ~]# vim /usr/local/apache2/conf/ht ...

  2. iOS 学习之 UITabBarController

    - (IBAction)btnClick:(id)sender { UITabBarController *tabBarCtrl = [[[UITabBarController alloc] init ...

  3. WebLogic 12c 多节点Cluster静默安装

    WebLogic集群架构 Weblogic角色 AdminServer: 172.16.65.130 NodeServer: 172.16.65.131.172.16.65.132 版本 weblog ...

  4. 字符串匹配算法BF和KMP总结

    背景 来看一道leetcode题目: Implement strStr(). Returns the index of the first occurrence of needle in haysta ...

  5. 集成Facebook SDK

    1. 下载SDK https://developers.facebook.com/docs/ios?locale=zh_CN 2. 如何集成 https://developers.facebook.c ...

  6. mysql安装失败后重装的方法

  7. Apache Phoenix基本操作-2

    1. 如何映射一个Phoenix的表到一个Hbase的表? 你可以通过Create table/create view DDL语句在一个已经存在的hbase表上创建一个Phoenix表或者视图.对于C ...

  8. nodejs mysql 操作数据库方法一详解

    nodejs mysql 数据查询例子 时间 2014-11-11 15:28:01  姜糖水原文  http://www.cnphp6.com/archives/59864 1.安装nodejs 2 ...

  9. SQL server 2008 T-sql 总结

    数据库的实现 1.添加数据:insert [into] 表名 (字段1,字段2,···) values (值1,值2,····)     其中,into可选. 2.修改数据:update 表名 set ...

  10. Spring初学之spring的事务管理xml

    所有的java类都是用的上一篇文章:Spring初学之spring的事务管理 不同的是,这时xml配置事务,所以就要把java类中的那些关于spring的注解都删掉,然后在xml中配置,Applica ...