[Mono-devel-list] [PATCH] Bug Fix for GetTickCount in WAPI IO Layer
Jesse Towner
townerj at gmail.com
Mon Feb 28 14:38:30 EST 2005
Paolo Molaro wrote:
>On 02/26/05 Jesse Towner wrote:
>
>
>Could you add configure tests for this, instead of using operating system
>defines?
>
>
>
Yes, that can be done.
>Do you have access to such systems? If the code is not tested
>it's better to not include it.
>
>
>
I'll remove code for the systems I can't test.
>Both these functions can be static in the file.
>
>
>
>> guint32 GetTickCount (void)
>> {
>> struct timeval tv;
>>- guint32 ret;
>>+
>>+ if (_wapi_get_uptime (&tv) == FALSE)
>>+ return 0;
>>
>>
>
>This function needs to be fast, so what you should do is:
>*) have an init function that the runtime can call at startup
>that gets the boot time. If no boot time is available, just
>register the process startup time: this means that the boot time
>is always defined.
>*) GetTickCount is changed to just call gettimeofday(), subtract
>the boot time and convert to milliseconds.
>
>Thanks.
>lupus
>
>
>
Yes, sure. I can do that. However, I'm a little unsure if I should bother
with all of these changes if they're not going to be committed anyway.
I know of at least a few people who have mistakenly used
System.Environment.TickCount and complained it didn't work the
way they expected it to on Mono. That's why I set out to see if I
could fix it in the first place.
------------------------------------------------------------------------
Jesse Towner, Lead Programmer, Hybrid Mobile Technologies, LLC
Email Addresses: <jtowner at hybrid-mobile.com>, <townerj at gmail.com>
PGP Public Key: http://www.virtuallyonline.net/personal/jesse/pgp.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050228/31ddef7c/attachment.bin
More information about the Mono-devel-list
mailing list