当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript app.getGPUFeatureStatus方法代码示例

本文整理汇总了TypeScript中electron.app.getGPUFeatureStatus方法的典型用法代码示例。如果您正苦于以下问题:TypeScript app.getGPUFeatureStatus方法的具体用法?TypeScript app.getGPUFeatureStatus怎么用?TypeScript app.getGPUFeatureStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在electron.app的用法示例。


在下文中一共展示了app.getGPUFeatureStatus方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: getSystemInfo

	async getSystemInfo(launchService: ILaunchService): Promise<SystemInfo> {
		const info = await launchService.getMainProcessInfo();
		const { memory, vmHint, os, cpus } = getMachineInfo();
		const systemInfo: SystemInfo = {
			os,
			memory,
			cpus,
			vmHint,
			processArgs: `${info.mainArguments.join(' ')}`,
			gpuStatus: app.getGPUFeatureStatus(),
			screenReader: `${app.isAccessibilitySupportEnabled() ? 'yes' : 'no'}`,
			remoteData: (await launchService.getRemoteDiagnostics({ includeProcesses: false, includeWorkspaceMetadata: false })).filter((x): x is IRemoteDiagnosticInfo => !(x instanceof Error))
		};


		if (!isWindows) {
			systemInfo.load = `${osLib.loadavg().map(l => Math.round(l)).join(', ')}`;
		}

		return Promise.resolve(systemInfo);
	}
开发者ID:PKRoma,项目名称:vscode,代码行数:21,代码来源:diagnosticsService.ts

示例2: getSystemInfo

export function getSystemInfo(info: IMainProcessInfo): SystemInfo {
	const MB = 1024 * 1024;
	const GB = 1024 * MB;

	const systemInfo: SystemInfo = {
		'Memory (System)': `${(os.totalmem() / GB).toFixed(2)}GB (${(os.freemem() / GB).toFixed(2)}GB free)`,
		VM: `${Math.round((virtualMachineHint.value() * 100))}%`,
		'Screen Reader': `${app.isAccessibilitySupportEnabled() ? 'yes' : 'no'}`,
		'Process Argv': `${info.mainArguments.join(' ')}`,
		'GPU Status': app.getGPUFeatureStatus()
	};

	const cpus = os.cpus();
	if (cpus && cpus.length > 0) {
		systemInfo.CPUs = `${cpus[0].model} (${cpus.length} x ${cpus[0].speed})`;
	}

	if (!isWindows) {
		systemInfo['Load (avg)'] = `${os.loadavg().map(l => Math.round(l)).join(', ')}`;
	}


	return systemInfo;
}
开发者ID:costincaraivan,项目名称:vscode,代码行数:24,代码来源:diagnostics.ts

示例3: expandGPUFeatures

function expandGPUFeatures(): string {
	const gpuFeatures = app.getGPUFeatureStatus();
	const longestFeatureName = Math.max(...Object.keys(gpuFeatures).map(feature => feature.length));
	// Make columns aligned by adding spaces after feature name
	return Object.keys(gpuFeatures).map(feature => `${feature}:  ${repeat(' ', longestFeatureName - feature.length)}  ${gpuFeatures[feature]}`).join('\n                  ');
}
开发者ID:costincaraivan,项目名称:vscode,代码行数:6,代码来源:diagnostics.ts

示例4: it

 it('returns the graphic features statuses', () => {
   const features = app.getGPUFeatureStatus()
   expect(features).to.have.ownProperty('webgl').that.is.a('string')
   expect(features).to.have.ownProperty('gpu_compositing').that.is.a('string')
 })
开发者ID:malept,项目名称:electron,代码行数:5,代码来源:api-app-spec.ts


注:本文中的electron.app.getGPUFeatureStatus方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。