In Gamasutra's latest technical feature, XS2theWorld senior developer Sergio Giucastro examines the problems that game developers can encounter when trying to get time at the low level on Android devices. Giucastro points out that modern mobile platforms have extremely accurate hardware timers. "For example, ARM CPUs like the Cortex A9 (Samsung Galaxy SII) has a 64-bit Global Timer Counter Register -- that is a really accurate monotonic, non-decreasing clock, cheap to read." According to the Cortex A9 ARM Cycle Timing document, using the LDM instruction takes only one CPU cycle. You can use the exact same concept on the Tegra platform using reading memory mapped RTC (Real Time Clock) registers, too. "Timing using the Time Stamp Counter is really fast, but on some platforms it can be dangerous as well," notes Giucastro. "In [the] case of multi-core systems, or during the low frequency/CPU saving state of the system, it may lead to errors. You should beware this, and calibrate it with the PIT on some systems." He adds, "The nightmare begins when you realize that different platforms have different kind of RTC, and that besides this, a lot of different hardware clocks exists in modern platforms: Time Stamp Counter, Programmable Interval Timer, High Precision Event Timer, ACPI PMT." Giucastro says that direct hardware access means writing primitives specific to a single platform. "Furthermore, developing ASM code takes more time, is not portable, and is difficult to read for most developers. Finally, the OS can raise an exception if the hardware resource you are trying to access requires supervisor/kernel mode." The full feature, in which Sergio Giucastro goes more into depth on getting the most accurate, least resource-intensive timing calls on the Android platform, is live now on Gamasutra.
The nightmare of getting time at the low level on Android
June 6, 2012

Tags:
2012
Subscribe to our newsletter
About JikGuard.com
JikGuard.com, a high-tech security service provider focusing on game protection and anti-cheat, is committed to helping game companies solve the problem of cheats and hacks, and providing deeply integrated encryption protection solutions for games.
Top

BATTLEFIELD 6 Unleashes All-Out Warfare With First Trailer; Multiplayer Reveal Coming Next Week
July 25, 2025

Active Campaign Exploits Cloud Flaws for Cryptomining
July 24, 2025

UK and Romania Crack Down on ATM Fraudster Network
July 24, 2025

Ransomware Deployed in Compromised SharePoint Servers
July 24, 2025

FBI Exposes The Com’s Criminal Activities and Involvement of Minors
July 24, 2025
Recent

BATTLEFIELD 6 Unleashes All-Out Warfare With First Trailer; Multiplayer Reveal Coming Next Week
July 25, 2025

Active Campaign Exploits Cloud Flaws for Cryptomining
July 24, 2025

UK and Romania Crack Down on ATM Fraudster Network
July 24, 2025

Ransomware Deployed in Compromised SharePoint Servers
July 24, 2025

FBI Exposes The Com’s Criminal Activities and Involvement of Minors
July 24, 2025

Malware Campaign Masquerades as Dating Apps to Steal Data
July 24, 2025

The Final Fantasy Tactics remake has been rebuilt from scratch due to source code being overwritten
July 24, 2025

Itch.io has "deindexed" all adult NSFW content following "scrutiny" from payment processors
July 24, 2025

UK Games Fund is predicted to generate £30-58 million in productivity benefits
July 24, 2025

1047 Games sends Splitgate 2 "back to beta," announces new round of layoffs
July 24, 2025
Blog

Are there hacks that increase gacha pull rates?
July 24, 2025

VMOS Open-Source: New Threat to Game Security
July 18, 2025

How Games Detect Black and Gray Studio
July 15, 2025

How Games Detect iOS Jailbreaks
July 11, 2025

FPS Game Anti-Cheat Solution
July 9, 2025

Black and Gray Industry Insights: HappyMod
July 7, 2025

Online Game Anti-Cheat Solution
July 4, 2025

iOS Code Encryption Solutions
June 26, 2025

Casual Game Security Risks Analysis and Solutions
June 25, 2025

Unity Resources Randomization Encryption Solution
June 19, 2025
Random

Ransomware Deployed in Compromised SharePoint Servers
July 24, 2025

Silent Hill: Townfall developer No Code rebrands as Screen Burn
July 23, 2025

Rematch reaches five million players one month after launch
July 23, 2025

Clorox Sues IT Service Provider Cognizant for Causing 2023 Cyber-Attack
July 23, 2025

Malware Campaign Masquerades as Dating Apps to Steal Data
July 24, 2025

LOLLIPOP CHAINSAW Sequel Announced With The Promise Of Staying True To The Spirit Of The Original
July 24, 2025

UK and Romania Crack Down on ATM Fraudster Network
July 24, 2025

Number of German game companies falls 4% in last year after "years of growth"
July 23, 2025

France: New Data Breach Could Affect 340,000 Jobseekers
July 23, 2025

IGEA launches Game On Australia, a new digital showcase highlighting Australian game development
July 23, 2025
Most Views

How Games Detect GameGuardian
March 17, 2025

Explanation of Game Anti-Cheat Solutions
March 17, 2025

Cheat Engine Modifier Detection Solutions
March 18, 2025

Explanation of Unity Engine Encryption Solutions
March 17, 2025

How to Anti Hack in Client-Side Games
May 21, 2025

Cocos Engine Encryption Solution
April 8, 2025

How Games Anti-Debugging
April 15, 2025

Cloud Phone Detection Solution for Gaming
May 21, 2025

How Games Detect Frida
March 25, 2025

How Games Detect PlayCover
March 26, 2025