Repository: PowerShell/PowerShell
File: src/System.Management.Automation/namespaces/FileSystemProvider.cs (C#)

Code before:
                    }

                    if (file != null)
                    {
                        long fileBytesSize = file.Length;

                        if (recurse)
                        {
                            // When recurse is specified we need to confirm each
                            // item before removal.
                            RemoveFileInfoItem(file, force);
                        }
                        else
                        {
                            // When recurse is not specified just delete all the
                            // subitems without confirming with the user.
                            RemoveFileSystemItem(file, force);
                        }

                        if (_totalFiles > 0)
                        {
                            _removedFiles++;
                            _removedBytes += fileBytesSize;
                            double speed = _removedBytes / 1024 / 1024 / _removeStopwatch.Elapsed.TotalSeconds;

                            if (_removeStopwatch.Elapsed.TotalSeconds > progressBarDurationThreshold)
                            {
                            var progress = new ProgressRecord(
                                REMOVE_FILE_ACTIVITY_ID,
                                StringUtil.Format(FileSystemProviderStrings.RemovingLocalFileActivity, _removedFiles, _totalFiles),
                                StringUtil.Format(FileSystemProviderStrings.RemovingLocalBytesStatus, Utils.DisplayHumanReadableFileSize(_removedBytes), Utils.DisplayHumanReadableFileSize(_totalBytes), speed)
                            );
                            var percentComplete = _totalBytes != 0 ? (int)Math.Min(_removedBytes * 100 / _totalBytes, 100) : 100;
                            progress.PercentComplete = percentComplete;
                            progress.RecordType = ProgressRecordType.Processing;
                            WriteProgress(progress);
                            }
                        }
                    }
                }

                // Check to see if the item has children
                bool hasChildren = DirectoryInfoHasChildItems(directory);

                if (hasChildren && !force)
                {
                    string error = StringUtil.Format(FileSystemProviderStrings.DirectoryNotEmpty, directory.FullName);
                    Exception e = new IOException(error);
                    WriteError(new ErrorRecord(e, "DirectoryNotEmpty", ErrorCategory.WriteError, directory));
                }
                else // !hasChildren || force

Review comment (suggestion):
Please follow our code style guideline - const should start with uppercase letter:
```suggestion
                            if (_removeStopwatch.Elapsed.TotalSeconds > ProgressBarDurationThreshold)
```

Code after:

                    if (file != null)
                    {
                        long fileBytesSize = file.Length;

                        if (recurse)
                        {
                            // When recurse is specified we need to confirm each
                            // item before removal.
                            RemoveFileInfoItem(file, force);
                        }
                        else
                        {
                            // When recurse is not specified just delete all the
                            // subitems without confirming with the user.
                            RemoveFileSystemItem(file, force);
                        }

                        if (_totalFiles > 0)
                        {
                            _removedFiles++;
                            _removedBytes += fileBytesSize;
                            if (_removeStopwatch.Elapsed.TotalSeconds > ProgressBarDurationThreshold)
                            {
                                double speed = _removedBytes / 1024 / 1024 / _removeStopwatch.Elapsed.TotalSeconds;
                                var progress = new ProgressRecord(
                                    REMOVE_FILE_ACTIVITY_ID,
                                    StringUtil.Format(FileSystemProviderStrings.RemovingLocalFileActivity, _removedFiles, _totalFiles),
                                    StringUtil.Format(FileSystemProviderStrings.RemovingLocalBytesStatus, Utils.DisplayHumanReadableFileSize(_removedBytes), Utils.DisplayHumanReadableFileSize(_totalBytes), speed)
                                );
                                var percentComplete = _totalBytes != 0 ? (int)Math.Min(_removedBytes * 100 / _totalBytes, 100) : 100;
                                progress.PercentComplete = percentComplete;
                                progress.RecordType = ProgressRecordType.Processing;
                                WriteProgress(progress);
                            }
                        }
                    }
                }

                // Check to see if the item has children
                bool hasChildren = DirectoryInfoHasChildItems(directory);

                if (hasChildren && !force)
                {
                    string error = StringUtil.Format(FileSystemProviderStrings.DirectoryNotEmpty, directory.FullName);
                    Exception e = new IOException(error);
                    WriteError(new ErrorRecord(e, "DirectoryNotEmpty", ErrorCategory.WriteError, directory));
                }
                else // !hasChildren || force
                {
                    // Finally, remove the directory