And with the CPLEX Python API just use Python's time module:
import time
start = time.time()
cplex.solve()
duration = time.time() - start
As an alternative to time.time() you can also use the get_time() member function of the Cplex class.
#CPLEXOptimizers#DecisionOptimization