當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。