I'm not sure I fully understand, but maybe just:
Stopwatch watch = Stopwatch.StartNew();
// where "xslt" is your prepared XslTransform or XslCompiledTransform
xslt.Transform(input, args, results);
watch.Stop();
TimeSpan elapsed = watch.Elapsed; // how long
:
string seconds = elapsed.TotalSeconds.ToString("0.000");
:
Stopwatch watch = Stopwatch.StartNew();
XPathDocument sourceDoc = new XPathDocument(location);
watch.Stop();
TimeSpan parseTime = watch.Elapsed;
watch.Reset();
watch.Start();
xslt.Transform(sourceDoc, args, results);
watch.Stop();
TimeSpan transformTime = watch.Elapsed;