登录
首页 » c++ » 设计并实现Unix的“time”命令

设计并实现Unix的“time”命令

于 2023-07-20 发布 文件大小:255.09 kB
0 100
下载积分: 2 下载次数: 1

代码说明:

设计并实现Unix的“time”命令。“mytime”命令通过命令行参数接受要运行的程序,创建一个独立的进程来运行该程序,并记录程序运行的时间。 在Windows下实现: • 使用CreateProcess()来创建进程 • 使用WaitForSingleObject()在“mytime”命令和新创建的进程之间同步 • 调用GetSystemTime()来获取时间 在Linux下实现: • 使用fork()/execv()来创建进程运行程序 • 使用wait()等待新创建的进程结束 • 调用gettimeofday()来获取时间 mytime的用法: $ mytime.exe program1 -$ mytime.exe program1

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • SETFTIME
    我在上个世纪写的一个批量修改文件时间属性的精致实用小程序,在Windows下可用(开发环境:DOS,BC3.1)。 (I write in the last century, a batch of time to modify the file property of the exquisite small practical procedures can be used under Windows [Development Environment: DOS, BC3.1].)
    2021-03-01 15:39:34下载
    积分:1
  • 大漠插件C++引用库
    C++调用大漠插件的引用文件,可以直接引入调用!
    2022-05-20 00:28:30下载
    积分:1
  • C++ Progarms-Baisc
    C++ programs for students
    2020-06-25 19:00:01下载
    积分:1
  • Bgiwer
    BorlandBGI示例 不知道大家是否用的到 希望大家有意见 可以联系我(BorlandBGI examples do not know whether we used to have hope that we can contact me advice)
    2005-03-24 19:32:51下载
    积分:1
  • caoshengbo
    超声波测距避障系统,实现机器人的智能化测距(Ultrasonic ranging obstacle avoidance system, realize the intellectualized ranging robot )
    2011-05-30 18:14:28下载
    积分:1
  • pagerank
    用于实现pagerank算法编程,只是一个算法,节点代表网页,边代表连接。(to achieve hl_end programming algorithm, only one algorithm, node representative website edge represents a link.)
    2020-11-27 08:09:30下载
    积分:1
  • GAOCHUNM编译.rar
    编译原理:中缀表达式转换为逆波浪式实验源程序(Compiler Principle : The conversion formula for the superintendent inverse source Wave Experiment)
    2005-06-27 16:03:28下载
    积分:1
  • RationalQuantifyUsage
    绝对原创,请站长加分啊,这是用来快速定位性能底下的一段测试代码,配合Quantify使用,上面附有说明,如何定位到。(Rational Quantify Usage)
    2014-06-06 10:48:34下载
    积分:1
  • 842274
    提供一个可以动态改变报表列的报表程序,并支持打印功能(Provides a report program that dynamically changes report columns and supports printing)
    2018-12-01 03:29:52下载
    积分:1
  • ChipBoardOperate
    剪贴板通信--虽然程序很简单,但是很好地解析了进程和线程的原理,是运用进程和线程的小例子(Clipboard communication- although a simple process, but the good analysis of the principles of process and thread, is to use a small example of the process and thread)
    2011-05-25 17:09:44下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载