diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-03-30 16:09:32 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-03-30 16:09:32 +0530 |
commit | aaf950e2ad5c07d4423f9822e3a0ae9f7b8d2bdf (patch) | |
tree | 9274139660f30c4857d80044eb4ac283aac1775a /src/webex/pages/benchmark.tsx | |
parent | 15e18440dbad55df19977a2eb7053681259afc18 (diff) | |
download | wallet-core-aaf950e2ad5c07d4423f9822e3a0ae9f7b8d2bdf.tar.xz |
re-format with prettier v2, fix HTML
Diffstat (limited to 'src/webex/pages/benchmark.tsx')
-rw-r--r-- | src/webex/pages/benchmark.tsx | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/src/webex/pages/benchmark.tsx b/src/webex/pages/benchmark.tsx index fe874f2b7..7de546bb0 100644 --- a/src/webex/pages/benchmark.tsx +++ b/src/webex/pages/benchmark.tsx @@ -14,7 +14,6 @@ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> */ - /** * Benchmarks for the wallet. * @@ -31,14 +30,12 @@ import * as React from "react"; import * as ReactDOM from "react-dom"; import { registerMountPage } from "../renderHtml"; - interface BenchmarkRunnerState { repetitions: number; result?: BenchmarkResult; running: boolean; } - function BenchmarkDisplay(props: BenchmarkRunnerState) { const result = props.result; if (!result) { @@ -50,24 +47,23 @@ function BenchmarkDisplay(props: BenchmarkRunnerState) { } return ( <> - <h2>Results for {result.repetitions} repetitions</h2> - <table className="pure-table"> - <thead> - <tr> - <th>{i18n.str`Operation`}</th> - <th>{i18n.str`time (ms/op)`}</th> - </tr> - { - Object.keys(result.time).sort().map( - k => - <tr> - <td>{k}</td> - <td>{result.time[k] / result.repetitions}</td> - </tr> - ) - } - </thead> - </table> + <h2>Results for {result.repetitions} repetitions</h2> + <table className="pure-table"> + <thead> + <tr> + <th>{i18n.str`Operation`}</th> + <th>{i18n.str`time (ms/op)`}</th> + </tr> + {Object.keys(result.time) + .sort() + .map((k) => ( + <tr> + <td>{k}</td> + <td>{result.time[k] / result.repetitions}</td> + </tr> + ))} + </thead> + </table> </> ); } @@ -91,10 +87,13 @@ class BenchmarkRunner extends React.Component<any, BenchmarkRunnerState> { return ( <div> <label>Repetitions:</label> - <input type="number" - value={this.state.repetitions} - onChange={(evt) => this.setState({ repetitions: Number.parseInt(evt.target.value) })} /> - {" "} + <input + type="number" + value={this.state.repetitions} + onChange={(evt) => + this.setState({ repetitions: Number.parseInt(evt.target.value) }) + } + />{" "} <button onClick={() => this.run()}>Run</button> <BenchmarkDisplay {...this.state} /> </div> |