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


TypeScript os.release函数代码示例

本文整理汇总了TypeScript中os.release函数的典型用法代码示例。如果您正苦于以下问题:TypeScript release函数的具体用法?TypeScript release怎么用?TypeScript release使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1:

////////////////////////////////////////////////////
/// os tests : https://nodejs.org/api/os.html
////////////////////////////////////////////////////

namespace os_tests {
    {
        let result: string;

        result = os.tmpdir();
        result = os.homedir();
        result = os.endianness();
        result = os.hostname();
        result = os.type();
        result = os.platform();
        result = os.arch();
        result = os.release();
        result = os.EOL;
    }

    {
        let result: number;

        result = os.uptime();
        result = os.totalmem();
        result = os.freemem();
    }

    {
        let result: number[];

        result = os.loadavg();
开发者ID:hongshanzhu,项目名称:DefinitelyTyped,代码行数:31,代码来源:node-tests.ts

示例2: computeStartupMetrics

	public computeStartupMetrics(): void {
		const now = Date.now();
		const initialStartup = !!this.isInitialStartup;
		const start = initialStartup ? this.start : this.windowLoad;

		let totalmem: number;
		let freemem: number;
		let cpus: { count: number; speed: number; model: string; };
		let platform: string;
		let release: string;
		let loadavg: number[];
		let meminfo: IMemoryInfo;
		let isVMLikelyhood: number;

		try {
			totalmem = os.totalmem();
			freemem = os.freemem();
			platform = os.platform();
			release = os.release();
			loadavg = os.loadavg();
			meminfo = process.getProcessMemoryInfo();

			isVMLikelyhood = Math.round((virtualMachineHint.value() * 100));

			const rawCpus = os.cpus();
			if (rawCpus && rawCpus.length > 0) {
				cpus = { count: rawCpus.length, speed: rawCpus[0].speed, model: rawCpus[0].model };
			}
		} catch (error) {
			console.error(error); // be on the safe side with these hardware method calls
		}

		this._startupMetrics = {
			version: 1,
			ellapsed: Math.round(this.workbenchStarted.getTime() - start.getTime()),
			timers: {
				ellapsedExtensions: Math.round(this.afterExtensionLoad.getTime() - this.beforeExtensionLoad.getTime()),
				ellapsedExtensionsReady: Math.round(this.afterExtensionLoad.getTime() - start.getTime()),
				ellapsedRequire: Math.round(this.afterLoadWorkbenchMain.getTime() - this.beforeLoadWorkbenchMain.getTime()),
				ellapsedViewletRestore: Math.round(this.restoreViewletDuration),
				ellapsedEditorRestore: Math.round(this.restoreEditorsDuration),
				ellapsedWorkbench: Math.round(this.workbenchStarted.getTime() - this.beforeWorkbenchOpen.getTime()),
				ellapsedWindowLoadToRequire: Math.round(this.beforeLoadWorkbenchMain.getTime() - this.windowLoad.getTime()),
				ellapsedTimersToTimersComputed: Date.now() - now
			},
			platform,
			release,
			totalmem,
			freemem,
			meminfo,
			cpus,
			loadavg,
			initialStartup,
			isVMLikelyhood,
			hasAccessibilitySupport: !!this.hasAccessibilitySupport,
			emptyWorkbench: this.isEmptyWorkbench
		};

		if (initialStartup) {
			this._startupMetrics.timers.ellapsedAppReady = Math.round(this.appReady.getTime() - this.start.getTime());
			this._startupMetrics.timers.ellapsedWindowLoad = Math.round(this.windowLoad.getTime() - this.appReady.getTime());
		}
	}
开发者ID:diarmaidm,项目名称:vscode,代码行数:63,代码来源:timerService.ts

示例3: parseFloat

			'description': nls.localize('autoDetectHighContrast', "If enabled, will automatically change to high contrast theme if Windows is using a high contrast theme, and to dark theme when switching away from a Windows high contrast theme."),
			'included': isWindows
		},
		'window.titleBarStyle': {
			'type': 'string',
			'enum': ['native', 'custom'],
			'default': isLinux ? 'native' : 'custom',
			'scope': ConfigurationScope.APPLICATION,
			'description': nls.localize('titleBarStyle', "Adjust the appearance of the window title bar. Changes require a full restart to apply.")
		},
		'window.nativeTabs': {
			'type': 'boolean',
			'default': false,
			'scope': ConfigurationScope.APPLICATION,
			'description': nls.localize('window.nativeTabs', "Enables macOS Sierra window tabs. Note that changes require a full restart to apply and that native tabs will disable a custom title bar style if configured."),
			'included': isMacintosh && parseFloat(os.release()) >= 16 // Minimum: macOS Sierra (10.12.x = darwin 16.x)
		},
		'window.nativeFullscreen': {
			'type': 'boolean',
			'default': true,
			'description': nls.localize('window.nativeFullscreen', "Prefer native full-screen. Disable this option to prevent macOS from creating a new space when going full-screen."),
			'included': isMacintosh
		},
		'window.clickThroughInactive': {
			'type': 'boolean',
			'default': true,
			'scope': ConfigurationScope.APPLICATION,
			'description': nls.localize('window.clickThroughInactive', "If enabled, clicking on an inactive window will both activate the window and trigger the element under the mouse if it is clickable. If disabled, clicking anywhere on an inactive window will activate it only and a second click is required on the element."),
			'included': isMacintosh
		}
	}
开发者ID:felipecaputo,项目名称:vscode,代码行数:31,代码来源:main.contribution.ts

示例4: LanguageManager

import { GlobalContainer } from "./models";
import { LanguageManager } from "./lib/language-manager";
import * as os from 'os';

export const languageManager = new LanguageManager();

export const APP: GlobalContainer = {
    lang: languageManager.getLanguage('English'),
    version: require('../package.json')['version'],
    os: require('os-name')(os.platform(), os.release()), 
    arch: os.arch()
};
开发者ID:kencinder,项目名称:steam-rom-manager,代码行数:12,代码来源:variables.ts


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