最近在做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. 容器rootfs

    挂载在容器根目录上.用来为容器进程提供隔离后执行环境的文件系统,就是所谓的“容器镜像”: 它还有一个更为专业的名称:rootfs (根文件系统). 所以,一个最常见的rootfs,或者说容器镜像,会包 ...

  2. Centos7.4 Nginx反向代理+负载均衡配置

    Ningx是一款高性能的HTTP和反向代理服务器,配置起来也比较简单. 测试环境: 172.16.65.190 Nginx-反向代理 172.16.65.191 Ningx-Web 172.16.65 ...

  3. spark学习6(Centos下Scala2.11.4安装)

    Centos下Scala安装 上传Scala到/usr/scala目录下 [root@spark1 scala]# chmod u+x scala-2.11.4.tgz #修改权限 [root@spa ...

  4. VMWARE TOOLS安装出错:THE PATH IS NOT A VALID PATH TO THE 3.11.0.12-GENERIC KERNEL HEADERS

    VMWARE TOOLS安装提示THE PATH IS NOT A VALID PATH TO THE GENERIC KERNEL HEADERS I solved this problem, I ...

  5. Java -- JDBC 批处理

    两种批处理方式: 采用Statement.addBatch(sql)方式实现批处理: •优点:可以向数据库发送多条不同的SQL语句. •缺点: •SQL语句没有预编译. •当向数据库发送多条语句相同, ...

  6. 在Windows下使用adb logcat grep

    在Windows下使用adb logcat  grep 会提示 因为grep 为Linux命令,所以不能使用.怎么办呢? 这时候可以用到babun 下载地址:http://babun.github.i ...

  7. flsk-SQLALchemy

    SQLALchemy 一.介绍     SQLALchemy是一个基于Python实现的ORM框架.该框架是建立在DB API之上,使用关系对象映射进行数据库操作     简言之便就是:将类和对象转换 ...

  8. VC++异常捕获??

    1. std: #include <string> #include<iostream> // for cerr //#include <stdexcept> // ...

  9. MySql基础学习-mysql安装

    Linux环境下的安装 1检查是否已经安装 sudo service mysql start #若未安装,则提示: mysql: unrecognized service 2安装MySql #安装 M ...

  10. 基于vue的滚动条组件之--element隐藏组件滚动条scrollbar使用

    在项目中,总是需要用到滚动条,但windows浏览器默认的滚动条是很丑的,为了页面美观,可以考虑优化滚动条样式.  vue Element UI官方文档上并没有放出滚动条相关的示例说明,但是实际上是有 ...