long startTime = System.currentTimeMillis();
GroovyTemplate template = getTemplate(name, context.getResourceResolver());
context.put("_ctx", context);
context.setGroovyTemplateService(this);
template.render(context.getWriter(), context, (Locale) context.get("locale"));
long endTime = System.currentTimeMillis();
TemplateStatistic templateStatistic = statisticService.getTemplateStatistic(name);
templateStatistic.setTime(endTime - startTime);
templateStatistic.setResolver(context.getResourceResolver());