I'm building a DSL application in XTend and I need to measure the time it takes to translate each document that I run through it.
I use the DSL capabilities to translate one data format (IFC) into another (TTL).
I tried to measure it using System.currentTimeMillis() in the doGenerate method of the generator (myDslGenerator.xtend) , but as far as I can see, this only measures the time it takes to write the output file, not the time it takes to parse the input file.
I don't need the time it takes to load the Eclipse application, just the actual time (not cpu-time) spent on translation for each file.
My current (wrong) approach gives me results between 0 and 500 ms for tasks that takes several (up to 20) seconds.
doGenerate is called from the ParallelBuilderParticipant class (handleChangedContents method) in the Eclipse dependencies, but I can't backtrace it any further to find where that is called from. But maybe this method actually wraps parsing as well (Resource resource = contect.resource) ?
Any insights would be great - thank you
EDIT: Trying to put some more information here - hope it's useful.
Measuring the runtime of the doGenerate method does give me the time it takes to write a ".ttl" file, but the time spent reading the ".ifc" file is not part of it, since it has been parsed before the doGenerate method is called. The doGenerate method is part of the XTend template, and comes from the AbstractGenerator.
Doing a usage search in the project, I can see that the doGenerate method is called from a Class called ParallelBuilderParticipant.
Will I find the full time it takes to parse one file and write another if I measure the time of this class instead? And if so, how do I do that, since this is a dependency .class file - Eclipse does not let me edit it.