Obviously, I know that I have response time in .jtl file and in listener called Aggregate report, but I'm looking for way to get reponse time of request to variable.
You can do it as follows:
Put the following code into PostProcessor's "Script" area:
vars.put("responseTime", String.valueOf(prev.getTime()));
It will get elapsed time for the sampler (in milliseconds) and store it into ${responseTime}
variable. You can add sampler label as prefix or postfix to distinguish response times for different samplers.
prev
is a shorthand for parent SampleResult instance.
See How to Use BeanShell: JMeter's Favorite Built-in Component for comprehensive information on Beanshell scripting in JMeter tests.