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_邹东耘_无25 #15

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

Conversation

strangerTHU
Copy link

谢谢学长!

// 只允许修改LongProgressByTime类中的代码
// 要求实现ILongProgressByTime中的要求
// 可利用Environment.TickCount64获取当前时间(单位ms)

//挑战:利用原子操作
//long.MaxValue非常久
public (long ElapsedTime, long NeedTime) GetProgress()
{
return (Environment.TickCount64-startTime,needTime);
Copy link
Owner

Choose a reason for hiding this comment

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

没有正确返回进度(没有正常更新startTime)


public long startTime;//从0开始加载的时间
public long needTime;//可能需要记一下总时间
public long elapsedTime;//已经经过的时间,当进度条使
Copy link
Owner

Choose a reason for hiding this comment

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

作用究竟是?

@@ -63,26 +63,75 @@ public interface ILongProgressByTime
public (long ElapsedTime, long NeedTime) GetProgress();
}

public class LongProgressByTime: ILongProgressByTime
public class LongProgressByTime : ILongProgressByTime
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