xiaoyanbot
V2EX  ›  问与答

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

  •  
  •   xiaoyanbot · Mar 15, 2018 · 1818 views
    This topic created in 3126 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   ·   Privacy   ·   Solana   ·   942 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 17ms · UTC 17:58 · PVG 01:58 · LAX 10:58 · JFK 13:58
    ♥ Do have faith in what you're doing.