Visual Studio 可以在构建日志中添加时间戳吗?
-
09-06-2019 - |
题
在构建日志中,我想要每个项目编译的开始和结束时间。有什么办法可以让VS做到这一点吗?
解决方案
对于 VC++ 构建,您可以启用构建计时。转到“工具”->“选项”->“项目和解决方案”->“VC++ 项目设置”,然后选择“构建计时”选项
其他提示
其他选项是提高 MSBuild 的详细程度。
Tools -> Options -> Projects and Solutions -> Build and Run ->
放 MSBuild project build output verbosity
到 Normal
. 。这会给你这样的输出:
------ Build started: MyProject, Configuration: Debug x86 ------
Build started 24/03/2014 08:46:18.
...
Build succeeded.
Time Elapsed 00:00:05.18
我发现的一种新方法是调用 Time
后事件中的命令 预 和 构建后事件命令行:
TIME /T
必须修改实际项目文件(使用文本编辑器)才能将调用添加到 MSBuild 脚本目标中。
不隶属于 StackOverflow