I\'ve read a number of other questions about Access to Modified closure so I understand the basic principle. Still, I couldn\'t tell - does Parallel.ForEach hav
You are accessing a modified closure, so it does apply. But, you are not changing its value while you are using it, so assuming you are not changing the values inside UpdateUsageStats you don't have a problem here.
Parallel.Foreach waits for the execution to end, and only then are you changing the values in startTime and endTime.