Stopwatch watch = new Stopwatch();
watch.Start();
for (int i = 0; i < iteration; i++)
{
positionRelative = source.InverseTransformPoint(target.position);
if (positionRelative.z > 0)
print("The target is in front of the source");
else
print("The target is behind the source");
}
watch.Stop();
dotProductTicks = watch.ElapsedTicks;
dotProductMs = watch.ElapsedMilliseconds;
ex :
using System.Diagnostics;