minigame-std
    Preparing search index...

    Function getDeviceBenchmarkLevel

    • 获取设备性能等级, web 环境返回 -2。

      Returns AsyncIOResult<number>

      返回设备性能等级。

      const result = await getDeviceBenchmarkLevel();
      if (result.isOk()) {
      const level = result.unwrap();
      if (level >= 30) {
      console.log('高性能设备');
      } else if (level >= 20) {
      console.log('中等性能设备');
      } else {
      console.log('低性能设备');
      }
      }