Digital Integration – How to Count the Number of Function Evaluations in NIntegrate

Try the option EvaluationMonitor

Block[{k = 0}, {NIntegrate[f[x], {x, -2, 1}, EvaluationMonitor :> k++], k}]

{0.0901049, 121}

Without using EvaluationMonitor you can do

ClearAll[f, ff]
f[x_] := Tanh[x] Sin[Exp[x]] Exp[-0.55 x^2 Exp[x^2]]

i = 0;
ff[y_?NumberQ] := Block[{x = y}, i++; f[x]]

{NIntegrate[ff[x], {x, -2, 1}], i}

{0.0901049, 121}