-
Notifications
You must be signed in to change notification settings - Fork 18
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
base: main
Are you sure you want to change the base?
CSharp_邹东耘_无25 #15
Conversation
// 只允许修改LongProgressByTime类中的代码 | ||
// 要求实现ILongProgressByTime中的要求 | ||
// 可利用Environment.TickCount64获取当前时间(单位ms) | ||
|
||
//挑战:利用原子操作 | ||
//long.MaxValue非常久 | ||
public (long ElapsedTime, long NeedTime) GetProgress() | ||
{ | ||
return (Environment.TickCount64-startTime,needTime); |
There was a problem hiding this comment.
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;//已经经过的时间,当进度条使 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没有任何所或者原子操作保证线程安全!
谢谢学长!