diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2019-04-28 01:19:58 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2019-04-28 01:19:58 +0200 |
| commit | f387845ae04226981aedb0fd0b8b55ee805883f3 (patch) | |
| tree | d2541634a6dcfc205469951471b3409b44c2ad51 | |
| parent | f82e99ccf61366c3528bf2777f532c76a148c98b (diff) | |
timing
| -rw-r--r-- | client/app.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/client/app.js b/client/app.js index 7635162..8a07f34 100644 --- a/client/app.js +++ b/client/app.js @@ -54,11 +54,13 @@ export default class PhashApp extends Component { } render() { + const { res } = this.state return ( <div className='app'> <h1>Search by Image</h1> {this.renderQuery()} {this.renderResults()} + {this.renderTiming()} </div> ) } @@ -142,4 +144,12 @@ export default class PhashApp extends Component { </div> ) } + + renderTiming() { + const { res } = this.state + if (res && res.timing) { + return <small>Query completed in {Math.round(res.timing * 1000)} ms</small> + } + return null + } }
\ No newline at end of file |
