1. 学习
  2. /
  3. 课程
  4. /
  5. Optimizing Code in Java

Connected

练习

Measuring operation time

String concatenation is a common operation that can be a performance bottleneck when not implemented efficiently. In this exercise, you'll measure how long it takes to concatenate strings using the + operator.

说明

100 XP
  • Record the start time and the end time before and after our operation.
  • Calculate the total duration for our operation using startTime and endTime.