Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(174)

Side by Side Diff: src/platform.h

Issue 23295034: Add Chromium-style TimeDelta, Time and TimeTicks classes, and a new ElapsedTimer class. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix windows build. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 199
200 // Clean up platform-OS-related things. Called once at VM shutdown. 200 // Clean up platform-OS-related things. Called once at VM shutdown.
201 static void TearDown(); 201 static void TearDown();
202 202
203 // Returns the accumulated user time for thread. This routine 203 // Returns the accumulated user time for thread. This routine
204 // can be used for profiling. The implementation should 204 // can be used for profiling. The implementation should
205 // strive for high-precision timer resolution, preferable 205 // strive for high-precision timer resolution, preferable
206 // micro-second resolution. 206 // micro-second resolution.
207 static int GetUserTime(uint32_t* secs, uint32_t* usecs); 207 static int GetUserTime(uint32_t* secs, uint32_t* usecs);
208 208
209 // Get a tick counter normalized to one tick per microsecond.
210 // Used for calculating time intervals.
211 static int64_t Ticks();
212
213 // Returns current time as the number of milliseconds since 209 // Returns current time as the number of milliseconds since
214 // 00:00:00 UTC, January 1, 1970. 210 // 00:00:00 UTC, January 1, 1970.
215 static double TimeCurrentMillis(); 211 static double TimeCurrentMillis();
216 212
217 // Returns a string identifying the current time zone. The 213 // Returns a string identifying the current time zone. The
218 // timestamp is used for determining if DST is in effect. 214 // timestamp is used for determining if DST is in effect.
219 static const char* LocalTimezone(double time); 215 static const char* LocalTimezone(double time);
220 216
221 // Returns the local time offset in milliseconds east of UTC without 217 // Returns the local time offset in milliseconds east of UTC without
222 // taking daylight savings time into account. 218 // taking daylight savings time into account.
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 static uint16_t HToN(uint16_t value); 801 static uint16_t HToN(uint16_t value);
806 static uint16_t NToH(uint16_t value); 802 static uint16_t NToH(uint16_t value);
807 static uint32_t HToN(uint32_t value); 803 static uint32_t HToN(uint32_t value);
808 static uint32_t NToH(uint32_t value); 804 static uint32_t NToH(uint32_t value);
809 }; 805 };
810 806
811 807
812 } } // namespace v8::internal 808 } } // namespace v8::internal
813 809
814 #endif // V8_PLATFORM_H_ 810 #endif // V8_PLATFORM_H_
OLDNEW
« no previous file with comments | « src/parser.cc ('k') | src/platform-linux.cc » ('j') | src/time/elapsed-timer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698