文件名称:2
- 所属分类:
- 进程与线程
- 资源属性:
- [Windows] [Visual.Net] [源码]
- 上传时间:
- 2015-05-27
- 文件大小:
- 21.22mb
- 下载次数:
- 0次
- 提 供 者:
- 王**
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
设计并实现Unix的“time”命令。“mytime”命令通过命令行参数接受要运行的程序,创建一个独立的进程来运行该程序,并记录程序运行的时间。
在Windows下实现:
• 使用CreateProcess()来创建进程
• 使用WaitForSingleObject()在“mytime”命令和新创建的进程之间同步
• 调用GetSystemTime()来获取时间
在Linux下实现:
• 使用fork()/execv()来创建进程运行程序
• 使用wait()等待新创建的进程结束
• 调用gettimeofday()来获取时间
mytime的用法:
$ mytime.exe program1
-Design and implementation of Unix " time" command. " Mytime" command accepts command line parameters to run the program, create a separate process to run the program, and record the running time. In the Windows implementation: • Use the CreateProcess () to create a process • Use WaitForSingleObject () between " mytime" command and the newly created process synchronization • Call GetSystemTime () to get the time realized under Linux: • Use fork ()/End execv () to create a process to run the program • Use wait () to wait for the newly created process • call gettimeofday () to get the time mytime usage: $ mytime.exe program1
在Windows下实现:
• 使用CreateProcess()来创建进程
• 使用WaitForSingleObject()在“mytime”命令和新创建的进程之间同步
• 调用GetSystemTime()来获取时间
在Linux下实现:
• 使用fork()/execv()来创建进程运行程序
• 使用wait()等待新创建的进程结束
• 调用gettimeofday()来获取时间
mytime的用法:
$ mytime.exe program1
-Design and implementation of Unix " time" command. " Mytime" command accepts command line parameters to run the program, create a separate process to run the program, and record the running time. In the Windows implementation: • Use the CreateProcess () to create a process • Use WaitForSingleObject () between " mytime" command and the newly created process synchronization • Call GetSystemTime () to get the time realized under Linux: • Use fork ()/End execv () to create a process to run the program • Use wait () to wait for the newly created process • call gettimeofday () to get the time mytime usage: $ mytime.exe program1
(系统自动生成,下载前可以参看下载内容)
下载文件列表
2
.\t1
.\..\Debug
.\..\.....\t1.exe
.\..\.....\t1.ilk
.\..\.....\t1.pdb
.\..\.....\test1.exe
.\..\t1
.\..\t1.sdf
.\..\t1.sln
.\..\t1.v14.suo
.\..\..\Debug
.\..\..\.....\Mytime.obj
.\..\..\.....\t1.log
.\..\..\.....\t1.tlog
.\..\..\.....\.......\CL.read.1.tlog
.\..\..\.....\.......\CL.write.1.tlog
.\..\..\.....\.......\link.read.1.tlog
.\..\..\.....\.......\link.write.1.tlog
.\..\..\.....\.......\t1.lastbuildstate
.\..\..\.....\vc140.idb
.\..\..\.....\vc140.pdb
.\..\..\Mytime.cpp
.\..\..\t1.vcxproj
.\..\..\t1.vcxproj.filters
.\test1
.\.....\Debug
.\.....\.....\test1.exe
.\.....\.....\test1.ilk
.\.....\.....\test1.pdb
.\.....\test1
.\.....\test1.sdf
.\.....\test1.sln
.\.....\test1.v14.suo
.\.....\.....\Debug
.\.....\.....\.....\test.obj
.\.....\.....\.....\test1.log
.\.....\.....\.....\test1.tlog
.\.....\.....\.....\..........\CL.read.1.tlog
.\.....\.....\.....\..........\CL.write.1.tlog
.\.....\.....\.....\..........\link.read.1.tlog
.\.....\.....\.....\..........\link.write.1.tlog
.\.....\.....\.....\..........\test1.lastbuildstate
.\.....\.....\.....\vc140.idb
.\.....\.....\.....\vc140.pdb
.\.....\.....\test.cpp
.\.....\.....\test1.vcxproj
.\.....\.....\test1.vcxproj.filters