xiaoyanbot
V2EX  ›  问与答

H5 中 DeviceMotionEvent 的触发频次是怎样的?

  •  
  •   xiaoyanbot · Mar 15, 2018 · 1587 views
    This topic created in 2988 days ago, the information mentioned may be changed or developed.

    类似下面的代码中,触发 devicemotion, 系统触发的频次是怎样的? 最低多少毫秒触发一次呢?

    
    if(window.DeviceMotionEvent) {
    	var speed = 20;
    	var x = y = z = lastX = lastY = lastZ = 0;
    	window.addEventListener('devicemotion', function(){
    		var acceleration =event.accelerationIncludingGravity;
    
    
    
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1028 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 19:01 · PVG 03:01 · LAX 12:01 · JFK 15:01
    ♥ Do have faith in what you're doing.