Args:
            duration (float): start coordinate press duration (seconds)

        [[FBRoute POST:@"/wda/dragfromtoforduration"] respondWithTarget:self action:@selector(handleDragCoordinate:)],
6854
def swipe(self, x1, y1, x2, y2, duration=0):
        
        data = dict(fromX=x1, fromY=y1, toX=x2, toY=y2, duration=duration)
        return self.http.post('/wda/dragfromtoforduration', data=data)
921260
def run_for_time(self, duration: float=10.0) -> None:
        ''''''

        Log.debug('running event loop for %.1f seconds', duration)
        try:
            asyncio.ensure_future(self.init())
            self.loop.run_until_complete(asyncio.sleep(duration))
            self.terminate()
            self.loop.run_forever()

        except RuntimeError as e:
            if not e.args[0].startswith('Event loop stopped'):
                raise

        finally:
            self.loop.close()
1211695
function triggerGesture(element, startPos, startTouches, gesture, done) {
            var interval = 10,
                loops = Math.ceil(gesture.duration / interval),
                loop = 1;

            function gestureLoop() {
                // calculate the radius
                var radius = gesture.radius;
                if (gesture.scale !== 1) {
                    radius = gesture.radius - (gesture.radius * (1 - gesture.scale) * (1 / loops * loop));
                }

                // calculate new position/rotation
                var posX = startPos[0] + (gesture.distanceX / loops * loop),
                    posY = startPos[1] + (gesture.distanceY / loops * loop),
                    rotation = typeof gesture.rotation == 'number' ? (gesture.rotation / loops * loop) : null,
                    touches = getTouches([posX, posY], startTouches.length, radius, rotation),
                    isFirst = (loop == 1),
                    isLast = (loop == loops);

                if (isFirst) {
                    triggerTouch(touches, element, 'start');
                } else if (isLast) {
                    triggerTouch(touches, element, 'end');
                    return done(touches);
                } else {
                    triggerTouch(touches, element, 'move');
                }

                setTimeout(gestureLoop, interval);
                loop++;
            }
            gestureLoop();
        }
194255
function (duration) {
    if (typeof duration !== 'string') {
      duration = duration + 'ms';
    }

    return this.each(function () {
      this.style.webkitTransitionDuration = duration;
      this.style.transitionDuration = duration;
    });
  }
976863
def dragEnterEvent(self, event):
        

        LOGGER.debug("> '{0}' widget drag enter event accepted!".format(self.__class__.__name__))
        event.accept()
159292
def mousePressEvent(self, event):
        """"""
        if event.button() == Qt.LeftButton:
            self.__drag_start_pos = QPoint(event.pos())
        QTabBar.mousePressEvent(self, event)
1113206
def set_duration(self, duration):
        
        fixed = sum(int(x.get('time', 0)) for x in self.slides)

        nfixed = len([x for x in self.slides if x.get('time', 0) > 0])

        unfixed = len(self.slides) - nfixed

        self.wait = max(1, int(duration / unfixed))
302979
function( start, end, duration, element, callback ) {
			createEventAtPoint("mousedown", start, element);
			startMove(start, end, duration, element, function() {
				createEventAtPoint("mouseup", end, element);
				callback();
			})
		}
937435
def timerEvent( self, event ):
        
        self.killTimer(event.timerId())
        
        self.setMaximumWidth(10000)
        self.setMaximumHeight(10000)
1193029
function (time) {
            last = now;
            now = time;
            delta = (now - last);

            // fix for negative timestamp returned by wechat or chrome on startup
            if (delta < 0) {
                delta = 0;
            }

            // get the game tick
            api.tick = (delta > minstep && me.sys.interpolation) ? delta / step : 1;

            for (var i = 0, len = timers.length; i < len; i++) {
                var _timer = timers[i];
                if (!(_timer.pauseable && me.state.isPaused())) {
                    _timer.elapsed += delta;
                }
                if (_timer.elapsed >= _timer.delay) {
                    _timer.fn.apply(null, _timer.args);
                    if (_timer.repeat === true) {
                        _timer.elapsed -= _timer.delay;
                    } else {
                        me.timer.clearTimeout(_timer.timerId);
                    }
                }
            }
        }
289275
def set_total_duration(self, duration):
        
        if duration < 1:
            raise ValueError(u'Duration must be postive')

        elif self.duration > duration:
            raise ValueError(u'{0} must be greater than current duration')

        self._total_duration = duration
424549
public LongPressOptions withDuration(Duration duration) {
        checkNotNull(duration);
        checkArgument(duration.toMillis() >= 0,
                "Duration value should be greater or equal to zero");
        this.duration = duration;
        return this;
    }
803435
def duration(self, value):
        

        if value is not None:
            assert type(value) is int, "'{0}' attribute: '{1}' type is not 'int'!".format("duration", value)
            assert value >= 0, "'{0}' attribute: '{1}' need to be exactly positive!".format("duration", value)
        self.__duration = value
859936
public static void vibrate(int duration) {
        Vibrator v = (Vibrator) QuickUtils.getContext().getSystemService(Context.VIBRATOR_SERVICE);
        v.vibrate(duration);
    }
1101984
function tap(position, element, done) {
                var touches = getTouches(position, 1);
                var gesture = {
                    duration: config.randomizer.integer({ min: 20, max: 700 })
                };

                triggerTouch(touches, element, 'start');

                setTimeout(function() {
                    triggerTouch(touches, element, 'end');
                    done(touches, gesture);
                }, gesture.duration);
            }
647973
function () {
        var self = this, startPos;

        setTimeout(function () {
          self.classes.add('in');
          self.fire('open');
        }, 0);

        self._super();

        if (self.statusbar) {
          self.statusbar.postRender();
        }

        self.focus();

        this.dragHelper = new DragHelper(self._id + '-dragh', {
          start: function () {
            startPos = {
              x: self.layoutRect().x,
              y: self.layoutRect().y
            };
          },

          drag: function (e) {
            self.moveTo(startPos.x + e.deltaX, startPos.y + e.deltaY);
          }
        });

        self.on('submit', function (e) {
          if (!e.isDefaultPrevented()) {
            self.close();
          }
        });

        windows.push(self);
        toggleFullScreenState(true);
      }
411985
function(focusWindow, fromPoint, toPoint, duration, callback){
		this.currentDataTransferItem = null;
		this.focusWindow = focusWindow;
	
		// A series of events to simulate a drag operation
		this._mouseOver(fromPoint);
		this._mouseEnter(fromPoint);
		this._mouseMove(fromPoint);
		this._mouseDown(fromPoint);
		this._dragStart(fromPoint);
		this._drag(fromPoint);
		this._dragEnter(fromPoint);
		this._dragOver(fromPoint);
		
		
		
		
		DragonDrop.startMove(fromPoint, toPoint, duration, function () {
			
			// this happens later
			DragonDrop._dragLeave(fromPoint);
			DragonDrop._dragEnd(fromPoint);
			DragonDrop._mouseOut(fromPoint);
			DragonDrop._mouseLeave(fromPoint);
			
			DragonDrop._drop(toPoint);
			DragonDrop._dragEnd(toPoint);
			DragonDrop._mouseOver(toPoint);
			DragonDrop._mouseEnter(toPoint);
			
			// these are the "user" moving the mouse away after the drop
			DragonDrop._mouseMove(toPoint);
			DragonDrop._mouseOut(toPoint);
			DragonDrop._mouseLeave(toPoint);

			
			callback();
			DragonDrop.cleanup();
		});
	}