使用 PowerShell 以毫秒为单位查找时间? [英] Find time in milliseconds using PowerShell?

查看:80
本文介绍了使用 PowerShell 以毫秒为单位查找时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用 PowerShell 找到以毫秒为单位的时间?

How can I find the time in milliseconds using PowerShell?

推荐答案

在 PowerShell 中,您可以将时间值转换为时间跨度并调用 TotalMilliseconds 方法:

In PowerShell you can cast a time value to a timespan and call the TotalMilliseconds method:

([TimeSpan]"00:05:00").TotalMilliseconds # Returns 300000

([TimeSpan] (Get-Date).ToShortTimeString()).TotalMilliseconds # Returns total milliseconds from 00:00:00 till now

这篇关于使用 PowerShell 以毫秒为单位查找时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆