Skip to content

Need a Get-ElapsedTime kind of function #15

@AnthonyMastrean

Description

@AnthonyMastrean

Something like

function Get-ElapsedTime() {
  param(
     [Parameter(Mandatory = $true)]
     [ValidateNotNullOrEmpty()]
     [scriptblock] $chunk
  )

  $watch = [system.diagnostics.stopwatch]::StartNew()
  Invoke-Expression $chunk
  $watch.Stop()

  # print?
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions