@Override
    public String execute(SampleResult previousResult, Sampler currentSampler) throws InvalidVariableException {
        String datetime;
        if (format.isEmpty()) {// Default to milliseconds
            datetime = Long.toString(System.currentTimeMillis());
        } else {
            // Resolve any aliases
            String fmt = aliases.get(format);
            if (fmt == null) {
                fmt = format;// Not found
            }
            datetime = DATE_TIME_FORMATTER_CACHE.get(fmt).get();
        }

        if (!variable.isEmpty()) {
            JMeterVariables vars = getVariables();
            if (vars != null){// vars will be null on TestPlan
                vars.put(variable, datetime);
            }
        }
        return datetime;
    }
@Test
    void testDefaultNone() throws Exception {
        long before = System.currentTimeMillis();
        value = variable.execute(result, null);
        long now = Long.parseLong(value);
        long after = System.currentTimeMillis();
        assertBetween(before, after, now);
    }