Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSharp_李浩源_無26 #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Z1131857044
Copy link

No description provided.

endTime = Environment.TickCount64;
elapsedTime = endTime - beginTime;
return (elapsedTime, needTime);
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没有采用任何锁或者原子操作保证线程安全!

public long NeedTime { get { return needTime; } set { needTime = value; } }
public bool Start(long needTime)
{
if (elapsedTime == 0)
Copy link
Owner

@shangfengh shangfengh Sep 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如此判断显然存在巨大问题,运行结果有误

elapsedTime = endTime - beginTime;
if (elapsedTime < needTime)
{
elapsedTime = 0;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请想清楚如何实现进度?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants