xiaoyanbot
V2EX  ›  问与答

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

  •  
  •   xiaoyanbot · Mar 15, 2018 · 1626 views
    This topic created in 3007 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   ·   4601 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 10:06 · PVG 18:06 · LAX 03:06 · JFK 06:06
    ♥ Do have faith in what you're doing.