惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google Online Security Blog
Google Online Security Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
C
CERT Recently Published Vulnerability Notes
C
Cybersecurity and Infrastructure Security Agency CISA
Cisco Talos Blog
Cisco Talos Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
Scott Helme
Scott Helme
Project Zero
Project Zero
E
Exploit-DB.com RSS Feed
S
Secure Thoughts
K
Kaspersky official blog
L
Lohrmann on Cybersecurity
NISL@THU
NISL@THU
WordPress大学
WordPress大学
N
News and Events Feed by Topic
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
L
LINUX DO - 热门话题
小众软件
小众软件
P
Privacy & Cybersecurity Law Blog
博客园 - 聂微东
Google DeepMind News
Google DeepMind News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
A
About on SuperTechFans
Hacker News: Ask HN
Hacker News: Ask HN
AWS News Blog
AWS News Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Hacker News: Front Page
F
Full Disclosure
Latest news
Latest news
Schneier on Security
Schneier on Security
The Hacker News
The Hacker News
T
Troy Hunt's Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Jina AI
Jina AI
Martin Fowler
Martin Fowler
P
Proofpoint News Feed
TaoSecurity Blog
TaoSecurity Blog
G
GRAHAM CLULEY
Forbes - Security
Forbes - Security
V
V2EX - 技术
酷 壳 – CoolShell
酷 壳 – CoolShell
V
Vulnerabilities – Threatpost
C
Cyber Attacks, Cyber Crime and Cyber Security
MongoDB | Blog
MongoDB | Blog
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
Hugging Face - Blog
Hugging Face - Blog
P
Privacy International News Feed
C
Check Point Blog
N
News and Events Feed by Topic

博客园 - Flouse

Java开发技术学习要点 0-1 背包问题的扩展 sql server平台用存储过程的分页 [新闻]Web 3.0带来新体验 SyncToy v2.0 发布 微软同步工具 - Flouse [推荐]一个JavaScript WEB日历控件 const char*, char const*, char*const的区别 Mozilla Thunderbird 3.0 Alpha 2 简体中文版 用友软件推出SaaS业务平台 推荐一款不错的笔记软件给大家 [收集]DotNetNuke(DNN)学习和应用资源合集 [讨论]提升DNN速度的方法 [推荐].NET开源项目 C# 开发和使用中的23个技巧(常用) 三层体系结构学习总结 关于三层体系结构 LINQ学习工具 [转][新闻]20世纪最好的10个算法 思考·未来的计算机是什么样子的呢?
任务管理器CPU曲线跑起正弦曲线
Flouse · 2008-06-30 · via 博客园 - Flouse

(很久之前做过的笔记,现贴出来,也忘了是哪抄来的程序了。)

  先来看看效果图,如果你是双核以上的,需要先在进程里将本程序设置为单核运行。

  方法:右键该进程-》关系-》CPU0

可执行程序下载:/Files/Flouse/controlTheTaskManager.rar

源代码:

#include <Windows.h>
#include 
<stdlib.h>
#include 
<math.h>

const double SPLIT = 0.01;
const int COUNT = 200;
const double PI = 3.14159265;
const int INTERVAL = 50;

int main(int argc, char* argv[]) {
    
// array of busy times
    DWORD busySpan[COUNT];
    
// arry of idle times
    DWORD idleSpan[COUNT];
    
int half = INTERVAL/2;
    
double radian = 0.0;
    
for (int i = 0; i < COUNT; i++{
        busySpan[i] 
= (DWORD)(half + (sin(PI*radian)*half));
        idleSpan[i] 
= INTERVAL - busySpan[i];
        radian 
+= SPLIT;
    }

    DWORD startTime 
= 0;
    
int j = 0;
    
while (true{
        j 
= j % COUNT;
        startTime 
= GetTickCount();
        
while (GetTickCount() - startTime <= busySpan[j]);
        Sleep(idleSpan[j]);
        j
++;
    }

    
return 0;
}