function [ ts, ks ] = setting_time( time, x, value, range )
% 惍掕帪娫
    sz = size(x); kf = sz(1);
    ok = abs(x - value) <= range;
    for k = find(ok)'
        if isempty( find( ok(k+1:kf) == 0 ) )
            ks = k; ts = time(k);
            return;
        end
    end
    ks = []; ts = [];
end
