CDN加速镜像 | 设为首页 | 加入收藏夹
当前位置: 首页 资源下载 源码下载 Windows编程 控制台(字符窗口)编程

文件名称:2

  • 所属分类:
  • 标签属性:
  • 上传时间:
    2014-04-17
  • 文件大小:
    2.7kb
  • 已下载:
    0次
  • 提 供 者:
  • 相关连接:
  • 下载说明:
    别用迅雷下载,失败请重下,重下不扣分!

介绍说明--下载内容来自于网络,使用问题请自行百度

实验二、进程控制(15分)



设计并实现Unix的“time”命令。“mytime”命令通过命令行参数接受要运行的程序,创建一个独立的进程来运行该程序,并记录程序运行的时间。



在Windows下实现:



使用CreateProcess()来创建进程

使用WaitForSingleObject()在“mytime”命令和新创建的进程之间同步

调用GetSystemTime()来获取时间

在Linux下实现:



使用fork()/execv()来创建进程运行程序

使用wait()等待新创建的进程结束

调用gettimeofday()来获取时间

mytime的用法:

$ mytime.exe program1



请注意运行结果的可读性,如:年月日时分秒毫秒微秒-The second experiment, process control (15 points) to design and implement the Unix " time" command. " Mytime" command from the command line arguments accepted to run the program, create a separate process to run the program, and record the program running time. In the Windows implementation: use CreateProcess () to create a process using WaitForSingleObject () between " mytime" command and the newly created process synchronous call GetSystemTime () to get the time in the Linux implementation: use fork ()/execv () to create a process to run the program using the wait () to wait for the end of the newly created process call gettimeofday () to get the time mytime usage: $ mytime.exe program1 Please note that the readability of the results, such as: YYMMDDHHMMSS milliseconds microseconds
(系统自动生成,下载前可以参看下载内容)

下载文件列表

实验二代码/
实验二代码/linux/
实验二代码/linux/2.c
实验二代码/linux/Readme.txt
实验二代码/linux/hello.c
实验二代码/windows/
实验二代码/windows/1Readme.txt
实验二代码/windows/father.c
实验二代码/windows/son.c

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 搜珍网是交换下载平台,只提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。更多...
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或换浏览器;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.

相关评论

暂无评论内容.

发表评论

*快速评论: 推荐 一般 有密码 和说明不符 不是源码或资料 文件不全 不能解压 纯粹是垃圾
*内  容:
*验 证 码:
搜珍网 www.dssz.com