Q:

How to compute the time that a machine learning model take to classify? 

I want to compute the time that a machine learning model takes to process to classify the data. 
I am using scikit-learn.  I can compute the accuracy, the recall and the precision by using: 
from sklearn.metrics import classification_report
from sklearn.metrics import confusion_matrix
from sklearn.metrics import accuracy_score
.....
model.fit(Xtrain, Ytrain)
y_pred = model.predict(Xtest)
print(accuracy_score(Ytest, y_pred))
print(confusion_matrix(Ytest, y_pred))
print(classification_report(Ytest, y_pred))

But I do not know how to compute the evaluation time of the classification.  Is there 

A:

Like this:
from time import time

t0 = time()
fit_classifier()
print(time() - t0)

