本文整理汇总了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();
示例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());
}
}
示例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
}
}
示例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()
};