public static Message<?> record(final Message<?> message,
                                    final String startTimeHeaderName,
                                    final String endTimeHeaderName,
                                    final String timingContextHeaderName) {

        long start = 0, end = 0;
        String context = (String) message.getHeaders().get(timingContextHeaderName);
        if (message.getHeaders().get(startTimeHeaderName) != null)
            start = ((Long)message.getHeaders().get(startTimeHeaderName)).longValue();

        if (message.getHeaders().get(endTimeHeaderName) != null)
            end = ((Long)message.getHeaders().get(endTimeHeaderName)).longValue();

        ThreadTimingContext threadTimingContext = getThreadTimingContext(Thread.currentThread().getName(), context);
        BigDecimal existingValue
                = points.get(threadTimingContext) != null ? points.get(threadTimingContext) : new BigDecimal(0);
        BigDecimal newValue = existingValue.add(BigDecimal.valueOf(end - start));
        points.put(threadTimingContext, newValue);

        return message;
    }