fsprojects / fsprojects/FSharpPlus
Stopwatch: measure function execution time
Nobody has claimed this yet.
- Dominant language
- F#
- Stars
- 941
- Forks
- 106
- PR merge metrics
- No merged PRs in 30d
Description
I discussed this idea with @gusty once on the fssf Slack, but just wanted to know if this could be relevant for the scope of FSharpPlus.
Lss,
[<RequireQualifiedAccess>]
module Stopwatch
open System.Diagnostics
let measure f =
let stopwatch = Stopwatch.StartNew()
let r = f()
stopwatch.Stop()
(r, stopwatch.Elapsed)
It's a simple helper, so not sure it is worthwhile to add it to the library
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the proposed F# Stopwatch module and measure function in the issue body, then inspect FSharpPlus conventions for small helpers and existing tests. Confirm whether this belongs in the library and, if accepted, define completion as an implemented helper with coverage for returning both the function result and elapsed time.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- fsharp
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100