mirror of
https://github.com/google/benchmark.git
synced 2025-01-27 20:30:15 +08:00
Reflow some wording. NFC
This commit is contained in:
parent
bdeb38718e
commit
924b8cee7a
11
README.md
11
README.md
@ -311,11 +311,12 @@ BENCHMARK_REGISTER_F(MyFixture, BarTest)->Threads(2);
|
|||||||
|
|
||||||
## Exiting Benchmarks in Error
|
## Exiting Benchmarks in Error
|
||||||
|
|
||||||
When external influences such as file I/O and network errors occur within
|
When errors caused by external influences, such as file I/O and network
|
||||||
a benchmark the `State::SkipWithError(const char* msg)` function can be used
|
communication, occur within a benchmark the
|
||||||
to skip that run of benchmark and report the error. Note that only future
|
`State::SkipWithError(const char* msg)` function can be used to skip that run
|
||||||
iterations of the `KeepRunning()` are skipped. Users may explicitly return
|
of benchmark and report the error. Note that only future iterations of the
|
||||||
to exit the benchmark immediately.
|
`KeepRunning()` are skipped. Users may explicitly return to exit the
|
||||||
|
benchmark immediately.
|
||||||
|
|
||||||
The `SkipWithError(...)` function may be used at any point within the benchmark,
|
The `SkipWithError(...)` function may be used at any point within the benchmark,
|
||||||
including before and after the `KeepRunning()` loop.
|
including before and after the `KeepRunning()` loop.
|
||||||
|
@ -269,7 +269,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// REQUIRES: timer is running and 'SkipWithError(...)' has not been called
|
// REQUIRES: timer is running and 'SkipWithError(...)' has not been called
|
||||||
// in the current thread.
|
// by the current thread.
|
||||||
// Stop the benchmark timer. If not called, the timer will be
|
// Stop the benchmark timer. If not called, the timer will be
|
||||||
// automatically stopped after KeepRunning() returns false for the first time.
|
// automatically stopped after KeepRunning() returns false for the first time.
|
||||||
//
|
//
|
||||||
@ -284,7 +284,7 @@ public:
|
|||||||
void PauseTiming();
|
void PauseTiming();
|
||||||
|
|
||||||
// REQUIRES: timer is not running and 'SkipWithError(...)' has not been called
|
// REQUIRES: timer is not running and 'SkipWithError(...)' has not been called
|
||||||
// in the current thread.
|
// by the current thread.
|
||||||
// Start the benchmark timer. The timer is NOT running on entrance to the
|
// Start the benchmark timer. The timer is NOT running on entrance to the
|
||||||
// benchmark function. It begins running after the first call to KeepRunning()
|
// benchmark function. It begins running after the first call to KeepRunning()
|
||||||
//
|
//
|
||||||
@ -298,15 +298,15 @@ public:
|
|||||||
// within each benchmark iteration, if possible.
|
// within each benchmark iteration, if possible.
|
||||||
void ResumeTiming();
|
void ResumeTiming();
|
||||||
|
|
||||||
// REQUIRES: 'SkipWithError(...)' has not been called previously in the
|
// REQUIRES: 'SkipWithError(...)' has not been called previously by the
|
||||||
// current thread.
|
// current thread.
|
||||||
// Skip any future iterations of the 'KeepRunning()' loop in the current
|
// Skip any future iterations of the 'KeepRunning()' loop in the current
|
||||||
// thread and report an error with the specified 'msg'. After this call
|
// thread and report an error with the specified 'msg'. After this call
|
||||||
// the user may explicitly 'return' from the benchmark.
|
// the user may explicitly 'return' from the benchmark.
|
||||||
//
|
//
|
||||||
// For threaded benchmarks only the current thread stops executing. If
|
// For threaded benchmarks only the current thread stops executing. If
|
||||||
// multiple threads report an error only the first error message will be used.
|
// multiple threads report an error only the first error message is used.
|
||||||
// The current thread is no longer considered 'active' thread by
|
// The current thread is no longer considered 'active' by
|
||||||
// 'PauseTiming()' and 'ResumingTiming()'.
|
// 'PauseTiming()' and 'ResumingTiming()'.
|
||||||
//
|
//
|
||||||
// NOTE: Calling 'SkipWithError(...)' does not cause the benchmark to exit
|
// NOTE: Calling 'SkipWithError(...)' does not cause the benchmark to exit
|
||||||
|
Loading…
Reference in New Issue
Block a user